Skip to content

Commit

Permalink
Fix crash from optimized null pointer access (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmciver authored Jan 24, 2025
1 parent 02ec3af commit 0dcc0ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm_util/llvm2alive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1902,11 +1902,13 @@ class llvm2alive_ : public llvm::InstVisitor<llvm2alive_, unique_ptr<Instr>> {
attrlist.getAttributes(llvm::AttributeList::FirstArgIndex + idx);

auto ty = llvm_type2alive(arg.getType());
if (!ty)
return {};
ParamAttrs attrs;
auto val = make_unique<Input>(*ty, value_name(arg));
Value *newval = val.get();

if (!ty || !handleParamAttrs(argattr, attrs, &newval, false))
if (!handleParamAttrs(argattr, attrs, &newval, false))
return {};
val->setAttributes(std::move(attrs));
add_identifier(arg, *newval);
Expand Down

0 comments on commit 0dcc0ba

Please sign in to comment.