Add a (temporary) limit consistency check

This commit is contained in:
Nigel Tao committed 2018-05-02 16:56:59 +10:00
1 parent 60a4e43635
commit 54d126db74
5 files changed
+123

No files matched your search

+8
View File
@@ -125,6 +125,10 @@ func (g *gen) writeLoadDerivedVar(b *buffer, name t.ID, typ *a.TypeExpr, header
b.printf("}\n")
b.printf("}\n")
// TODO: remove this temporary consistency check.
b.printf("if (%srend_%s != %srptr_%s + len) { status = 101; self->private_impl.status = status; return status; }",
bPrefix, nameStr, bPrefix, nameStr)
b.printf("%srend_%s = %srptr_%s + len;", bPrefix, nameStr, bPrefix, nameStr)
}
@@ -166,6 +170,10 @@ func (g *gen) writeLoadDerivedVar(b *buffer, name t.ID, typ *a.TypeExpr, header
b.printf("}\n")
b.printf("}\n")
// TODO: remove this temporary consistency check.
b.printf("if (%swend_%s != %swptr_%s + len) { status = 102; self->private_impl.status = status; return status; }",
bPrefix, nameStr, bPrefix, nameStr)
b.printf("%swend_%s = %swptr_%s + len;", bPrefix, nameStr, bPrefix, nameStr)
b.printf("}\n")
}