Skip to content

Commit

Permalink
Fix: incorrect string index published in inline assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
positively-charged committed May 24, 2017
1 parent f2d1bfd commit 9e4a461
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/codegen/asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,17 @@ static void write_arg( struct codegen* codegen, struct inline_asm_arg* arg ) {

static void write_expr_arg( struct codegen* codegen,
struct inline_asm_arg* arg ) {
c_arg( codegen, arg->value.expr->value );
struct indexed_string* string = NULL;
if ( arg->value.expr->has_str ) {
struct indexed_string* string = t_lookup_string( codegen->task,
arg->value.expr->value );
string = t_lookup_string( codegen->task, arg->value.expr->value );
if ( string ) {
c_append_string( codegen, string );
}
}
if ( string ) {
c_arg( codegen, string->index_runtime );
}
else {
c_arg( codegen, arg->value.expr->value );
}
}

0 comments on commit 9e4a461

Please sign in to comment.