authorgravatar for codroid@gmail.comhryx <codroid@gmail.com> 2019-05-27 17:54:40-07:00
committergravatar for codroid@gmail.comhryx <codroid@gmail.com> 2019-05-27 17:54:40-07:00
log22299869baaa4e65c3dae48b292b1bd8bd4b1c58
treef33d7f98e7e1f6c5d5fefe119c321f48595c2e4f
parente1f3eec9cc05535b3f3b81f2fb7cd65dd4d1e841
signaturelock-open Commit is signed but in an unrecognized format.

Prevent infinite recursion


1 files changed, 3 insertions(+), 2 deletions(-)

src-self-hosted/translate_c.zig+3-2
...@@ -459,9 +459,10 @@ fn transImplicitCastExpr(...@@ -459,9 +459,10 @@ fn transImplicitCastExpr(
459 const c = rp.c;459 const c = rp.c;
460 switch (ZigClangImplicitCastExpr_getCastKind(expr)) {460 switch (ZigClangImplicitCastExpr_getCastKind(expr)) {
461 .BitCast => {461 .BitCast => {
462 const node = try transExpr(rp, scope, @ptrCast(*const ZigClangExpr, expr), .used, .r_value);462 const sub_expr = ZigClangImplicitCastExpr_getSubExpr(expr);
463 const node = try transExpr(rp, scope, @ptrCast(*const ZigClangExpr, sub_expr), .used, .r_value);
463 const dest_type = getExprQualType(c, @ptrCast(*const ZigClangExpr, expr));464 const dest_type = getExprQualType(c, @ptrCast(*const ZigClangExpr, expr));
464 const src_type = getExprQualType(c, ZigClangImplicitCastExpr_getSubExpr(expr));465 const src_type = getExprQualType(c, sub_expr);
465 return try transCCast(rp, scope, ZigClangImplicitCastExpr_getBeginLoc(expr), dest_type, src_type, node.node);466 return try transCCast(rp, scope, ZigClangImplicitCastExpr_getBeginLoc(expr), dest_type, src_type, node.node);
466 },467 },
467 else => |kind| return revertAndWarn(468 else => |kind| return revertAndWarn(