bitcoin-core / btcdeb

Bitcoin Script Debugger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newly enabled opcodes execute after invalid OP_IF statement

brqgoo-zz opened this issue · comments

commented

Newly enabled opcodes like CAT, SUBSTR etc are executing after false OP_IF statements.

exec aabbcc ddeeff OP_1 OP_2 OP_GREATERTHAN OP_IF OP_CAT OP_ENDIF

In the example above, although OP_GREATERTHAN statement is false, OP_CAT executes after OP_IF and leaves stack with aabbccddeeff.

Good catch! Fix upcoming.

On top of #76 I now get:

btcdeb> exec aabbcc ddeeff OP_1 OP_2 OP_GREATERTHAN OP_IF OP_CAT OP_ENDIF
		<> PUSH stack aabbcc
		<> PUSH stack ddeeff
		<> PUSH stack 01
		<> PUSH stack 02
		<> POP  stack
		<> POP  stack
		<> PUSH stack
		<> POP  stack
script  |  stack
--------+--------
        |  ddeeff
        |  aabbcc
commented

All good now. Thanks.