Skip to content

Commit ffdf10f

Browse files
committed
Java trace validation: byte extract may apply to arrays and others
There is no reason to restrict byte extract applications to actual constants (these are, actually, unlikely the expected source operand of a byte extract). With upcoming fixes array_nonconstsize_nonconstaccess will rightly apply byte extracts to arrays.
1 parent 3e490c9 commit ffdf10f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

jbmc/src/java_bytecode/java_trace_validation.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,18 +285,7 @@ static void check_rhs_assumptions(
285285
// check byte extract rhs structure
286286
else if(const auto byte = expr_try_dynamic_cast<byte_extract_exprt>(rhs))
287287
{
288-
DATA_CHECK_WITH_DIAGNOSTICS(
289-
vm,
290-
byte->operands().size() == 2,
291-
"RHS",
292-
rhs.pretty(),
293-
"Expecting a byte extract with two operands.");
294-
DATA_CHECK_WITH_DIAGNOSTICS(
295-
vm,
296-
can_cast_expr<constant_exprt>(simplify_expr(byte->op(), ns)),
297-
"RHS",
298-
rhs.pretty(),
299-
"Expecting a byte extract with constant value.");
288+
check_rhs_assumptions(simplify_expr(byte->op(), ns), ns, vm);
300289
DATA_CHECK_WITH_DIAGNOSTICS(
301290
vm,
302291
can_cast_expr<constant_exprt>(simplify_expr(byte->offset(), ns)),

0 commit comments

Comments
 (0)