Zero-initialize bool-typed coro local variables

Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6470
This commit is contained in:
Nigel Tao committed 2018-02-21 16:00:25 +11:00
1 parent fbdc648b1a
commit 11ad47af86
5 files changed
+57 -7

No files matched your search

+6 -2
View File
@@ -229,7 +229,11 @@ func (g *gen) writeFuncImplBodyResume(b *buffer) error {
b.printf("uint32_t coro_susp_point = self->private_impl.%s%s[0].coro_susp_point;\n",
cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
b.printf("if (coro_susp_point) {\n")
if err := g.writeResumeSuspend(b, g.currFunk.astFunc.Body(), false); err != nil {
if err := g.writeResumeSuspend(b, g.currFunk.astFunc.Body(), false, false); err != nil {
return err
}
b.writes("} else {\n")
if err := g.writeResumeSuspend(b, g.currFunk.astFunc.Body(), false, true); err != nil {
return err
}
b.writes("}\n")
@@ -267,7 +271,7 @@ func (g *gen) writeFuncImplBodySuspend(b *buffer) error {
b.printf("self->private_impl.%s%s[0].coro_susp_point = coro_susp_point;\n",
cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
if err := g.writeResumeSuspend(b, g.currFunk.astFunc.Body(), true); err != nil {
if err := g.writeResumeSuspend(b, g.currFunk.astFunc.Body(), true, false); err != nil {
return err
}
b.writes("\n")