Copy entire regular expression into the code buffer (483920, r=gal).

This commit is contained in:
dmandelin@mozilla.com 2009-03-17 19:28:14 -07:00
Родитель 82f73fcb3c
Коммит 63a6565c23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -2349,7 +2349,7 @@ class RegExpNativeCompiler {
{
LIns* skip = lirBufWriter->skip(sizeof(GuardRecord) +
sizeof(RESideExit) +
re_length - sizeof(jschar));
(re_length-1) * sizeof(jschar));
GuardRecord* guard = (GuardRecord *) skip->payload();
memset(guard, 0, sizeof(*guard));
RESideExit* exit = (RESideExit*)(guard+1);
@ -2357,7 +2357,7 @@ class RegExpNativeCompiler {
guard->exit->target = fragment;
exit->re_flags = re->flags;
exit->re_length = re_length;
memcpy(exit->re_chars, re_chars, re_length);
memcpy(exit->re_chars, re_chars, re_length * sizeof(jschar));
fragment->lastIns = lir->insGuard(LIR_loop, lir->insImm(1), skip);
return guard;
}