Skip to content

Commit b9282c5

Browse files
GuillaumeGomezantoyo
authored andcommitted
Add explanations for ptr func call argument cast
1 parent 920dfa4 commit b9282c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/builder.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
253253
self.context.new_cast(self.location, actual_val, expected_ty)
254254
} else if on_stack_param_indices.contains(&index) {
255255
let ty = actual_val.get_type();
256+
// It's possible that the value behind the pointer is actually not exactly
257+
// the expected type, so to go around that, we add a cast before
258+
// dereferencing the value.
256259
if let Some(pointee_val) = ty.get_pointee()
257260
&& pointee_val != expected_ty
258261
{

0 commit comments

Comments
 (0)