Skip to content

Commit

Permalink
fix #939: crash in asm mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Sep 25, 2023
1 parent a5f6717 commit f65a7fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ir/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ static StateValue bytesToValue(const Memory &m, const vector<Byte> &bytes,

// allow ptr->int type punning in Assembly mode
if (bitsize == bits_program_pointer &&
m.getState().getFn().getFnAttrs().has(FnAttrs::Asm)) {
has_null_block && // a ptr load in src sets this to true
m.getState().getFn().getFnAttrs().has(FnAttrs::Asm)) {
StateValue ptr_val = bytesToValue(m, bytes, PtrType(0));
ptr_val.value = Pointer(m, ptr_val.value).getAddress();
expr is_ptr = bytes[0].isPtr();
Expand Down

0 comments on commit f65a7fb

Please sign in to comment.