diff --git a/nimbus/vm/computation.nim b/nimbus/vm/computation.nim index c5bb91768..a8c1411c2 100644 --- a/nimbus/vm/computation.nim +++ b/nimbus/vm/computation.nim @@ -213,7 +213,6 @@ proc applyMessage*(computation: BaseComputation, opCode: static[Op]) = postExecuteVM(computation) executeOpcodes(computation) - computation.nextProc() proc addChildComputation*(computation: BaseComputation, child: BaseComputation) = if child.isError: diff --git a/nimbus/vm/interpreter/opcodes_impl.nim b/nimbus/vm/interpreter/opcodes_impl.nim index 192ed26cc..1a4e5ef07 100644 --- a/nimbus/vm/interpreter/opcodes_impl.nim +++ b/nimbus/vm/interpreter/opcodes_impl.nim @@ -593,6 +593,7 @@ op create, inline = false, value, startPosition, size: var childComp = setupCreate(computation, memPos, len, value) if childComp.isNil: return + computation.child = childComp continuation(childComp): computation.addChildComputation(childComp) @@ -763,6 +764,7 @@ template genCall(callName: untyped, opCode: Op): untyped = ## STATICCALL, 0xfa, Static message-call into an account. var childComp = `callName Setup`(computation, callName.astToStr) + computation.child = childComp continuation(childComp): addChildComputation(computation, childComp) diff --git a/nimbus/vm/interpreter_dispatch.nim b/nimbus/vm/interpreter_dispatch.nim index 8e2fac6e4..1038344e0 100644 --- a/nimbus/vm/interpreter_dispatch.nim +++ b/nimbus/vm/interpreter_dispatch.nim @@ -234,6 +234,7 @@ proc opTableToCaseStmt(opTable: array[Op, NimNode], computation: NimNode): NimNo try: let fork = `computation`.getFork if `computation`.execPrecompiles(fork): + computation.nextProc() return if `computation`.tracingEnabled: @@ -248,6 +249,7 @@ proc opTableToCaseStmt(opTable: array[Op, NimNode], computation: NimNode): NimNo let msg = getCurrentExceptionMsg() let errorMsg = "Opcode Dispatch Error msg=" & msg & ", depth=" & $computation.msg.depth `computation`.setError(errorMsg, true) + computation.nextProc() macro genFrontierDispatch(computation: BaseComputation): untyped = result = opTableToCaseStmt(FrontierOpDispatch, computation) diff --git a/nimbus/vm_types.nim b/nimbus/vm_types.nim index b71ee91e9..c75bdfa4f 100644 --- a/nimbus/vm_types.nim +++ b/nimbus/vm_types.nim @@ -71,6 +71,7 @@ type nextProc*: proc() memOutLen*: int memOutPos*: int + child*: BaseComputation Error* = ref object info*: string