summaryrefslogtreecommitdiffstats
path: root/vendor/modernc.org/ccgo/v3/lib/go.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/modernc.org/ccgo/v3/lib/go.go')
-rw-r--r--vendor/modernc.org/ccgo/v3/lib/go.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/modernc.org/ccgo/v3/lib/go.go b/vendor/modernc.org/ccgo/v3/lib/go.go
index 8e6bccc7..fc869395 100644
--- a/vendor/modernc.org/ccgo/v3/lib/go.go
+++ b/vendor/modernc.org/ccgo/v3/lib/go.go
@@ -3117,6 +3117,9 @@ func (p *project) declaratorDecay(n cc.Node, f *function, d *cc.Declarator, t cc
return
}
+ if !local.isPinned {
+ p.err(n, "%v: %v: missed pinning", n.Position(), d.Position(), d.Name())
+ }
p.w("(%s%s)/* &%s[0] */", f.bpName, nonZeroUintptr(local.off), local.name)
return
}
@@ -8135,6 +8138,11 @@ func (p *project) castExpressionValue(f *function, n *cc.CastExpression, t cc.Ty
case cc.CastExpressionUnary: // UnaryExpression
p.unaryExpression(f, n.UnaryExpression, t, mode, flags)
case cc.CastExpressionCast: // '(' TypeName ')' CastExpression
+ if f != nil && p.pass1 && n.TypeName.Type().IsIntegerType() && n.CastExpression.Operand.Type().Kind() == cc.Array {
+ if d := n.CastExpression.Declarator(); d != nil {
+ f.pin(n, d)
+ }
+ }
switch k := p.opKind(f, n.CastExpression, n.CastExpression.Operand.Type()); k {
case opNormal, opBitfield:
p.castExpressionValueNormal(f, n, t, mode, flags)
@@ -12561,7 +12569,7 @@ func (p *project) iterationStatement(f *function, n *cc.IterationStatement) {
break
}
- v := "ok"
+ v := "__ccgo"
if !p.pass1 {
v = f.scope.take(cc.String(v))
}