fix unit test crash
MODIFY
tests/alive-tv/memory/ptr2int-poison.ident.ll
tests/alive-tv/memory/ptr2int-poison.ident.ll
-define void @fn() {
- %i7 = ptrtoint i8* poison to i8
- ret void
+define i8 @fn() {
+ %i = ptrtoint ptr poison to i8
+ ret i8 %i
}

MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -989,8 +989,10 @@ static void calculateAndInitConstants(Transform &t) {
observes_addresses |= has_int2ptr || has_ptr2int;
// condition can happen with ptr2int(poison)
- if (has_ptr2int && num_nonlocals == 0)
+ if (has_ptr2int && num_nonlocals == 0) {
+ ++num_nonlocals_src;
++num_nonlocals;
+ }
if (!does_int_mem_access && !does_ptr_mem_access && has_fncall)
does_int_mem_access = true;

fix unit test crash