Skip to content

Commit

Permalink
add EOC marker to emitter dump
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Nov 26, 2024
1 parent 5a879a6 commit bade6d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/chuck_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,15 @@ Chuck_VM_Code * emit_engine_emit_prog( Chuck_Emitter * emit, a_Program prog,
// check success code
if( ret )
{
// get next instruction index
t_CKUINT index = emit->next_index();
// pop global scope (added 1.3.0.0)
emit->pop_scope();
// append end of code
emit->append( new Chuck_Instr_EOC );
// add code str to whichever instruction began this section | 1.5.4.2 (ge) added
emit->code->code[index]->prepend_codestr( "/* end of code */" );

// make sure
assert( emit->context->nspc->pre_ctor == NULL );
// converted to virtual machine code
Expand Down

0 comments on commit bade6d2

Please sign in to comment.