Skip to content

Commit

Permalink
Fix inverted pointer use (rust-lang#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Sep 5, 2022
1 parent 1bd0e82 commit bf2b112
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion enzyme/Enzyme/AdjointGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8685,8 +8685,9 @@ class AdjointGenerator
auto ifound = gutils->invertedPointers.find(orig);
PHINode *placeholder = nullptr;
if (ifound != gutils->invertedPointers.end()) {
placeholder = cast<PHINode>(&*ifound->second);
if (shadowReturnUsed)
invertedReturn = placeholder = cast<PHINode>(&*ifound->second);
invertedReturn = placeholder;
}

Value *normalReturn = subretused ? newCall : nullptr;
Expand Down

0 comments on commit bf2b112

Please sign in to comment.