mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
5f54298bcd
commit
e097313c8f
@ -543,6 +543,11 @@ Str VM::disassemble(CodeObject_ co){
|
|||||||
if(byte.op == OP_JUMP_ABSOLUTE || byte.op == OP_POP_JUMP_IF_FALSE || byte.op == OP_SHORTCUT_IF_FALSE_OR_POP){
|
if(byte.op == OP_JUMP_ABSOLUTE || byte.op == OP_POP_JUMP_IF_FALSE || byte.op == OP_SHORTCUT_IF_FALSE_OR_POP){
|
||||||
jumpTargets.push_back(byte.arg);
|
jumpTargets.push_back(byte.arg);
|
||||||
}
|
}
|
||||||
|
if(byte.op == OP_GOTO){
|
||||||
|
// TODO: pre-compute jump targets for OP_GOTO
|
||||||
|
int* target = co->labels.try_get_2(StrName(byte.arg));
|
||||||
|
if(target != nullptr) jumpTargets.push_back(*target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
int prev_line = -1;
|
int prev_line = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user