Skip to content

Commit

Permalink
Parse poison values as non-deterministic values
Browse files Browse the repository at this point in the history
Signed-off-by: Hernan Ponce de Leon <[email protected]>
  • Loading branch information
hernan-poncedeleon committed Nov 12, 2023
1 parent b08f153 commit 18f1817
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,14 @@ 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.
BooleanType booleanType = types.getBooleanType();
var nondeterministicExpression = new BNonDet(booleanType);
return expressions.makeCast(nondeterministicExpression, expectedType);
}

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

0 comments on commit 18f1817

Please sign in to comment.