Skip to content

Commit

Permalink
Parse poison values as non-deterministic values (#565)
Browse files Browse the repository at this point in the history
Signed-off-by: Hernan Ponce de Leon <[email protected]>
Co-authored-by: Hernan Ponce de Leon <[email protected]>
  • Loading branch information
hernanponcedeleon and hernan-poncedeleon authored Nov 13, 2023
1 parent 33fb46f commit d3981bf
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,12 @@ public Expression visitArrayConst(ArrayConstContext ctx) {
return expressions.makeArray(elementType, arrayValues, true);
}

@Override
public Expression visitPoisonConst(PoisonConstContext ctx) {
// It is correct to replace a poison value with an undef value or any value of the type.
return makeNonDetOfType(expectedType);
}

@Override
public Expression visitStructConst(StructConstContext ctx) {
List<Expression> structMembers = new ArrayList<>();
Expand Down

0 comments on commit d3981bf

Please sign in to comment.