aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-01-05 13:47:00 +0000
committergingerBill <bill@gingerbill.org>2024-01-05 13:47:00 +0000
commitd7d23e65eae616d44cc070edff8171eb3160b5b0 (patch)
treee1e4961377097f335ec061758a6c0ef02907ec7b /src/checker.cpp
parent2820bbc269bb989052163544f2764bc4287254e4 (diff)
Clean up error block usage
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index ac885222d..d25acb15e 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -4025,12 +4025,11 @@ gb_internal void check_collect_value_decl(CheckerContext *c, Ast *decl) {
if (c->foreign_context.default_cc > 0) {
cc = c->foreign_context.default_cc;
} else if (is_arch_wasm()) {
- begin_error_block();
+ ERROR_BLOCK();
error(init, "For wasm related targets, it is required that you either define the"
" @(default_calling_convention=<string>) on the foreign block or"
" explicitly assign it on the procedure signature");
error_line("\tSuggestion: when dealing with normal Odin code (e.g. js_wasm32), use \"contextless\"; when dealing with Emscripten like code, use \"c\"\n");
- end_error_block();
}
}
e->Procedure.link_prefix = c->foreign_context.link_prefix;
@@ -4077,8 +4076,7 @@ gb_internal void check_collect_value_decl(CheckerContext *c, Ast *decl) {
if (e->kind != Entity_Procedure) {
if (fl != nullptr) {
- begin_error_block();
- defer (end_error_block());
+ ERROR_BLOCK();
AstKind kind = init->kind;
error(name, "Only procedures and variables are allowed to be in a foreign block, got %.*s", LIT(ast_strings[kind]));