From 7c8a166b9149e0a00089ad8d6efecc2e3076b19f Mon Sep 17 00:00:00 2001 From: "kmillikin@chromium.org" Date: Mon, 20 Jul 2009 12:28:02 +0000 Subject: [PATCH] Fix another site where a stack-allocated character was treated as a one-element character array. This was safe at this site but potentially confusing. BUG=17103 Review URL: http://codereview.chromium.org/159072 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2511 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/interpreter-irregexp.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/interpreter-irregexp.cc b/src/interpreter-irregexp.cc index 0a8ae8c..ae914d3 100644 --- a/src/interpreter-irregexp.cc +++ b/src/interpreter-irregexp.cc @@ -51,9 +51,11 @@ static bool BackRefMatchesNoCase(int from, unibrow::uchar old_char = subject[from++]; unibrow::uchar new_char = subject[current++]; if (old_char == new_char) continue; - interp_canonicalize.get(old_char, '\0', &old_char); - interp_canonicalize.get(new_char, '\0', &new_char); - if (old_char != new_char) { + unibrow::uchar old_string[1] = { old_char }; + unibrow::uchar new_string[1] = { new_char }; + interp_canonicalize.get(old_char, '\0', old_string); + interp_canonicalize.get(new_char, '\0', new_string); + if (old_string[0] != new_string[0]) { return false; } } -- 2.7.4