class VmBytecodeForwardJump

Defined at line 61 of file ../../src/developer/debug/zxdb/expr/vm_stream.h

These helper classes assist in filling out a forward jump where the destination of the jump

is not yet known.

When used, the corresponding jump instruction is emitted with an invalid destination. When the

stream has been appended such that the destination of the jump is now the end of the stream, call

JumpToHere() which will fill in the current stream index into the destination of the previously

emitted instruction.

"Using" means either instantiating it with the constructor that takes parameters or using

SetSource(). SetSource() is provided for jumps that may be conditionally included: if the

zero-arg constructor is called and SetSource() is never called, nothing will happen when the

destination is known.

This will assert if you forget to call JumpToHere() and the class goes out of scope.

stream.push_back(...);

VmBytecodeForwardJump jump_out(stream);

stream.push_back(...); // More instructions to jump over.

jump_out.JumpToHere(); // The previous jump should end up here.

Public Methods

void VmBytecodeForwardJump ()

Defined at line 63 of file ../../src/developer/debug/zxdb/expr/vm_stream.h

void VmBytecodeForwardJump (VmStream * stream)

Defined at line 64 of file ../../src/developer/debug/zxdb/expr/vm_stream.h

void SetSource (VmStream * stream)

Defined at line 67 of file ../../src/developer/debug/zxdb/expr/vm_stream.h