Pointer::get_value should check validity of p
MODIFY
ir/memory.cpp
ir/memory.cpp
@@ -366,6 +366,9 @@ expr Pointer::get_attrs() const {
expr Pointer::get_value(const char *name, const FunctionExpr &local_fn,
const FunctionExpr &nonlocal_fn,
const expr &ret_type, bool src_name) const {
+ if (!p.isValid())
+ return {};
+
auto bid = get_short_bid();
expr non_local;

ADD
tests/alive-tv/intptrload.src.ll
+define i64 @f(i64 %x) {
+ %p = inttoptr i64 %x to i64*
+ %a = load i64, i64* %p
+ ret i64 %a
+}
+
+; XFAIL: Invalid expr

ADD
tests/alive-tv/intptrload.tgt.ll
+define i64 @f(i64 %x) {
+ unreachable
+}

Pointer::get_value should check validity of p (#270)