From a5f67171fd6bfde8b937d1b87d9d185c4850cdf5 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Mon, 25 Sep 2023 16:12:10 +0100 Subject: [PATCH] fix #938: crash in asm mode --- ir/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir/memory.cpp b/ir/memory.cpp index 5a8284c49..53babf34a 100644 --- a/ir/memory.cpp +++ b/ir/memory.cpp @@ -545,7 +545,7 @@ static StateValue bytesToValue(const Memory &m, const vector &bytes, val = toType.fromInt(val.trunc(bitsize, toType.np_bits(true))); // allow ptr->int type punning in Assembly mode - if (bitsize == bits_ptr_address && + if (bitsize == bits_program_pointer && m.getState().getFn().getFnAttrs().has(FnAttrs::Asm)) { StateValue ptr_val = bytesToValue(m, bytes, PtrType(0)); ptr_val.value = Pointer(m, ptr_val.value).getAddress();