Commit f2e7adf1 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[parser] Fix intrinsic name matching

Bug: chromium:1028669
Change-Id: I3f690508f09a98b6b6b0f3808033fac4fae40700
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1940248
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65207}
parent 8a139889
......@@ -441,8 +441,12 @@ int Context::IntrinsicIndexForName(Handle<String> string) {
#undef COMPARE_NAME
#define COMPARE_NAME(index, type, name) \
if (strncmp(string, #name, length) == 0) return index;
#define COMPARE_NAME(index, type, name) \
{ \
const int name_length = static_cast<int>(arraysize(#name)) - 1; \
if ((length == name_length) && strncmp(string, #name, name_length) == 0) \
return index; \
}
int Context::IntrinsicIndexForName(const unsigned char* unsigned_string,
int length) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment