File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/solvers/smt2_incremental Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -598,6 +598,36 @@ static smt_termt convert_expr_to_smt(
598
598
return convert_multiary_operator_to_terms (
599
599
plus, converted, smt_bit_vector_theoryt::add);
600
600
}
601
+ else if (can_cast_type<pointer_typet>(plus.type ()))
602
+ {
603
+ INVARIANT (
604
+ plus.operands ().size () == 2 ,
605
+ " We are only handling a binary version of plus when it has a pointer "
606
+ " operand" );
607
+
608
+ exprt pointer;
609
+ exprt scalar;
610
+ for (auto &operand : plus.operands ())
611
+ {
612
+ if (can_cast_type<pointer_typet>(operand.type ()))
613
+ {
614
+ pointer = operand;
615
+ }
616
+ else
617
+ {
618
+ scalar = operand;
619
+ }
620
+ }
621
+
622
+ pointer_typet pointer_type =
623
+ *type_try_dynamic_cast<pointer_typet>(pointer.type ());
624
+ auto base_type = pointer_type.base_type ();
625
+ auto pointer_size = pointer_sizes.at (base_type);
626
+
627
+ return smt_bit_vector_theoryt::add (
628
+ converted.at (pointer),
629
+ smt_bit_vector_theoryt::multiply (converted.at (scalar), pointer_size));
630
+ }
601
631
else
602
632
{
603
633
UNIMPLEMENTED_FEATURE (
You can’t perform that action at this time.
0 commit comments