Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
compileImplicitCastExpr: toVoid
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Apr 9, 2022
1 parent 1ae3ede commit 02aeae6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cl/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ func compileImplicitCastExpr(ctx *blockCtx, v *ast.Node) {
func compileTypeCast(ctx *blockCtx, v *ast.Node, src goast.Node) {
toVoid := v.CastKind == ast.ToVoid
if toVoid { // _ = expr
cb := ctx.cb.VarRef(nil)
cb, _ := closureStartT(ctx, types.Typ[types.Int])
cb.VarRef(nil)
compileExpr(ctx, v.Inner[0])
cb.Assign(1)
cb.Assign(1).Val(0).Return(1).End().Call(0)
return
}
t := toType(ctx, v.Type, 0)
Expand Down

0 comments on commit 02aeae6

Please sign in to comment.