Currently, pointer to integral type casts are not modeled properly in
the symbol tree.
Below
void foo(int *p) { 12 - (long)p; }
the resulting symbol for the BinOP is an IntSymExpr. LHS is 12 and the RHS is
&SymRegion{reg_$0<int * p>}.
Even though, the SVal that is created for (long)p is correctly an
LocAsInteger, we loose this information when we build up the symbol tree for
12 - (long)p. To preserve the cast, we have to create a new node in
the symbol tree that represents it: the SymbolCast. This
is what this patch does.
This reverts D115149, except the test cases.
We should handle LHS as well.