aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-03-23 17:51:56 +0000
committergingerBill <bill@gingerbill.org>2024-03-23 17:51:56 +0000
commit517d7ae0b0fd400ceb6a213e7d644c19b8088bfd (patch)
tree55faac045297e438df0a8819f77677eb1f8fdc7f /src/check_builtin.cpp
parentefb0933965669a5b4b8c5534d4f77fc29ddab732 (diff)
Add error block around `error_line` calls
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index d3158961e..53e4acbd1 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -89,6 +89,7 @@ gb_internal void check_or_else_split_types(CheckerContext *c, Operand *x, String
gb_internal void check_or_else_expr_no_value_error(CheckerContext *c, String const &name, Operand const &x, Type *type_hint) {
+ ERROR_BLOCK();
gbString t = type_to_string(x.type);
error(x.expr, "'%.*s' does not return a value, value is of type %s", LIT(name), t);
if (is_type_union(type_deref(x.type))) {
@@ -1565,6 +1566,7 @@ gb_internal bool check_builtin_procedure_directive(CheckerContext *c, Operand *o
}
if (!operand->value.value_bool) {
+ ERROR_BLOCK();
gbString arg1 = expr_to_string(ce->args[0]);
gbString arg2 = {};
@@ -1590,6 +1592,7 @@ gb_internal bool check_builtin_procedure_directive(CheckerContext *c, Operand *o
operand->type = t_untyped_bool;
operand->mode = Addressing_Constant;
} else if (name == "panic") {
+ ERROR_BLOCK();
if (ce->args.count != 1) {
error(call, "'#panic' expects 1 argument, got %td", ce->args.count);
return false;