fix crash in mkFnRet()
MODIFY
ir/memory.cpp
ir/memory.cpp
@@ -691,7 +691,9 @@ static set<expr> extract_possible_local_bids(Memory &m, const expr &eptr) {
}
unsigned Memory::nextNonlocalBid() {
- unsigned next = min(next_nonlocal_bid++, num_nonlocals_src - 1 - has_fncall);
+ unsigned next
+ = min(next_nonlocal_bid++,
+ num_nonlocals_src-1 - num_inaccessiblememonly_fns - has_write_fncall);
assert(!is_fncall_mem(next));
return next;
}

ADD
tests/alive-tv/memory/inaccessiblememonly5.ident.ll
+define i8 @src() {
+ %x = alloca i8
+ call void @bar()
+ call i8* @foo()
+ ret i8 0
+}
+
+declare i8* @foo()
+declare void @bar() inaccessiblememonly

fix crash in mkFnRet()