summaryrefslogtreecommitdiff
path: root/src/parser/parsers.h
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-11-15 16:18:29 -0500
committerGitHub <noreply@github.com>2024-11-15 13:18:29 -0800
commit368c1edf2a6182dcde7a91e6facbf3dbdd6c7456 (patch)
tree048eb337ab186d3548a3b4460de39e513e5da4a6 /src/parser/parsers.h
parentce1a2b480ae89e65b4d94e1bb3332c5980e2479f (diff)
downloadbinaryen-368c1edf2a6182dcde7a91e6facbf3dbdd6c7456.tar.gz
binaryen-368c1edf2a6182dcde7a91e6facbf3dbdd6c7456.tar.bz2
binaryen-368c1edf2a6182dcde7a91e6facbf3dbdd6c7456.zip
Mark Result and MaybeResult [[nodiscard]] (#7083)
Since these types may be carrying errors that need to be handled or propagated, it is always an error not to use them in some way. Adding the [[nodiscard]] attribute caused the compiler to find a few instances where we were incorrectly ignoring results. Fix these places.
Diffstat (limited to 'src/parser/parsers.h')
-rw-r--r--src/parser/parsers.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parser/parsers.h b/src/parser/parsers.h
index 4121788d7..2d3321dcd 100644
--- a/src/parser/parsers.h
+++ b/src/parser/parsers.h
@@ -1099,7 +1099,7 @@ block(Ctx& ctx, const std::vector<Annotation>& annotations, bool folded) {
auto type = blocktype(ctx);
CHECK_ERR(type);
- ctx.makeBlock(pos, annotations, label, *type);
+ CHECK_ERR(ctx.makeBlock(pos, annotations, label, *type));
CHECK_ERR(instrs(ctx));
@@ -1162,7 +1162,7 @@ ifelse(Ctx& ctx, const std::vector<Annotation>& annotations, bool folded) {
return ctx.in.err("else label does not match if label");
}
- ctx.visitElse();
+ CHECK_ERR(ctx.visitElse());
CHECK_ERR(instrs(ctx));
@@ -1205,7 +1205,7 @@ loop(Ctx& ctx, const std::vector<Annotation>& annotations, bool folded) {
auto type = blocktype(ctx);
CHECK_ERR(type);
- ctx.makeLoop(pos, annotations, label, *type);
+ CHECK_ERR(ctx.makeLoop(pos, annotations, label, *type));
CHECK_ERR(instrs(ctx));