We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3897b39 commit 0a3b99bCopy full SHA for 0a3b99b
jbmc/src/java_bytecode/java_pointer_casts.cpp
@@ -118,8 +118,12 @@ exprt make_clean_pointer_cast(
118
return bare_ptr;
119
120
exprt superclass_ptr=bare_ptr;
121
+ // Looking at base types discards generic qualifiers (because those are
122
+ // recorded on the pointer, not the pointee), so it may still be necessary
123
+ // to use a cast to reintroduce the qualifier (for example, the base might
124
+ // be recorded as a List, when we're looking for a List<E>)
125
if(find_superclass_with_type(superclass_ptr, target_base, ns))
- return superclass_ptr;
126
+ return typecast_exprt::conditional_cast(superclass_ptr, target_type);
127
128
return typecast_exprt(bare_ptr, target_type);
129
}
0 commit comments