Skip to content

Commit 0dcc0ba

Browse files
authored
Fix crash from optimized null pointer access (AliveToolkit#1162)
1 parent 02ec3af commit 0dcc0ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm_util/llvm2alive.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1902,11 +1902,13 @@ class llvm2alive_ : public llvm::InstVisitor<llvm2alive_, unique_ptr<Instr>> {
19021902
attrlist.getAttributes(llvm::AttributeList::FirstArgIndex + idx);
19031903

19041904
auto ty = llvm_type2alive(arg.getType());
1905+
if (!ty)
1906+
return {};
19051907
ParamAttrs attrs;
19061908
auto val = make_unique<Input>(*ty, value_name(arg));
19071909
Value *newval = val.get();
19081910

1909-
if (!ty || !handleParamAttrs(argattr, attrs, &newval, false))
1911+
if (!handleParamAttrs(argattr, attrs, &newval, false))
19101912
return {};
19111913
val->setAttributes(std::move(attrs));
19121914
add_identifier(arg, *newval);

0 commit comments

Comments
 (0)