Block non-bytecode Statements in bytecode calls
This commit is contained in:
parent
db4f7d0973
commit
4cd8e5ded2
@ -1576,6 +1576,12 @@ class CmdCallDirect(
|
|||||||
?: error("CALL_DIRECT expects ObjRef at $id")
|
?: error("CALL_DIRECT expects ObjRef at $id")
|
||||||
val callee = ref.value
|
val callee = ref.value
|
||||||
val args = frame.buildArguments(argBase, argCount)
|
val args = frame.buildArguments(argBase, argCount)
|
||||||
|
if (callee is Statement) {
|
||||||
|
val bytecodeBody = (callee as? BytecodeBodyProvider)?.bytecodeBody()
|
||||||
|
if (callee !is BytecodeStatement && callee !is BytecodeCallable && bytecodeBody == null && isAstStatement(callee)) {
|
||||||
|
frame.ensureScope().raiseIllegalState("bytecode runtime cannot call non-bytecode Statement")
|
||||||
|
}
|
||||||
|
}
|
||||||
val result = if (PerfFlags.SCOPE_POOL) {
|
val result = if (PerfFlags.SCOPE_POOL) {
|
||||||
frame.ensureScope().withChildFrame(args) { child -> callee.callOn(child) }
|
frame.ensureScope().withChildFrame(args) { child -> callee.callOn(child) }
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user