From 97f257097762498bff7e4b7da9d52d77058cd3ab Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 14 Oct 2018 12:52:52 +1100 Subject: [PATCH] Fix codegen for skip_fast args[0] is actual, args[1] is worst_case. --- cmd/wuffs-c/internal/cgen/builtin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/wuffs-c/internal/cgen/builtin.go b/cmd/wuffs-c/internal/cgen/builtin.go index 59ea5fd6..ecca6675 100644 --- a/cmd/wuffs-c/internal/cgen/builtin.go +++ b/cmd/wuffs-c/internal/cgen/builtin.go @@ -149,7 +149,7 @@ func (g *gen) writeBuiltinIOReader(b *buffer, recv *a.Expr, method t.ID, args [] // call (to a static inline function) instead of a struct literal, to // avoid a "expression result unused" compiler error. b.writes("(iop_a_src += ") - if err := g.writeExpr(b, args[1].AsArg().Value(), rp, depth); err != nil { + if err := g.writeExpr(b, args[0].AsArg().Value(), rp, depth); err != nil { return err } b.writes(", wuffs_base__return_empty_struct())")