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 5c6400b commit 17f6dbbCopy full SHA for 17f6dbb
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