Skip to content

Commit ce8f21a

Browse files
committed
tapscript: update execContext with code sep opcode position
1 parent f6c483e commit ce8f21a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Script/Interpreter/Interpreter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ public function evaluate(ScriptInterface $script, Stack $mainStack, int $sigVers
564564
}
565565
$hashStartPos = 0;
566566
$opCount = 0;
567+
$opCodePos = 0;
567568
$zero = gmp_init(0, 10);
568569
$altStack = new Stack();
569570
$vfStack = new Stack();
@@ -1072,6 +1073,7 @@ public function evaluate(ScriptInterface $script, Stack $mainStack, int $sigVers
10721073

10731074
case Opcodes::OP_CODESEPARATOR:
10741075
$hashStartPos = $parser->getPosition();
1076+
$execContext->setCodeSeparatorPosition($opCodePos);
10751077
break;
10761078

10771079
case Opcodes::OP_CHECKSIGADD:
@@ -1231,6 +1233,8 @@ public function evaluate(ScriptInterface $script, Stack $mainStack, int $sigVers
12311233
if (count($mainStack) + count($altStack) > self::MAX_STACK_SIZE) {
12321234
throw new \RuntimeException('Invalid stack size, exceeds 1000');
12331235
}
1236+
1237+
$opCodePos++;
12341238
}
12351239
}
12361240

0 commit comments

Comments
 (0)