aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/translate_c.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/translate_c.zig b/src/translate_c.zig
index a6715d161c..7fd4b93821 100644
--- a/src/translate_c.zig
+++ b/src/translate_c.zig
@@ -1748,7 +1748,8 @@ fn transBinaryOperator(
const lhs_expr = stmt.getLHS();
const lhs_qt = getExprQualType(c, lhs_expr);
const lhs_qt_translated = try transQualType(c, scope, lhs_qt, lhs_expr.getBeginLoc());
- const elem_type = lhs_qt_translated.castTag(.c_pointer).?.data.elem_type;
+ const c_pointer = getContainer(c, lhs_qt_translated).?;
+ const elem_type = c_pointer.castTag(.c_pointer).?.data.elem_type;
const sizeof = try Tag.sizeof.create(c.arena, elem_type);
const bitcast = try Tag.bit_cast.create(c.arena, .{ .lhs = ptrdiff_type, .rhs = infixOpNode });