Skip to content

Commit b45f0e3

Browse files
committed
[js] Get $!cstack from a cursor correctly and prepare for a VMArray being stored there.
1 parent 8e22038 commit b45f0e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vm/js/RegexCompiler.nqp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class RegexCompiler {
6767
self.case($!initial_label),
6868
self.compile_rx($node),
6969
self.case($restart_label),
70-
"$!cstack = $!cursor[\"\$!cstack\"];",
71-
"if ($!cstack instanceof nqp.NQPArray) $!cstack = $!cstack.array;\n",
70+
"$!cstack = {self.get_cursor_attr($!cursor, '$!cstack')};",
71+
"if ($!cstack && $!cstack.\$\$toArray) $!cstack = $!cstack.\$\$toArray;\n",
7272
self.case($!fail_label),
7373
"if ($!bstack.length == 0) \{{self.goto($!done_label)}\}\n",
7474
"$cstack_top = $!bstack.pop();\n",

0 commit comments

Comments
 (0)