mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Take more care with a NULL reader1 or writer1 buf.
This commit is contained in:
1 parent
10b7d5a031
commit
7b6f7384d1
6 files changed
+28
-21
No files matched your search
@@ -159,14 +159,14 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.KeySlice, 2) {
|
||||
b.printf("puffs_base_make_slice_u8(%sdst.buf->ptr,", aPrefix)
|
||||
b.printf("puffs_base_make_slice_u8(%sdst.buf ? %sdst.buf->ptr : NULL,", aPrefix, aPrefix)
|
||||
for _, o := range n.Args() {
|
||||
if err := g.writeExpr(b, o.Arg().Value(), rp, parenthesesOptional, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes(".ptr,")
|
||||
}
|
||||
b.printf("%swptr_dst)", bPrefix)
|
||||
b.printf("%sdst.buf ? %swptr_dst : NULL)", aPrefix, bPrefix)
|
||||
return nil
|
||||
}
|
||||
if isThatMethod(g.tm, n, t.KeyLength, 0) {
|
||||
|
||||
Reference in new issue
Block a user