aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-02-26 10:56:32 +0000
committergingerBill <bill@gingerbill.org>2021-02-26 10:56:32 +0000
commitd772710ae729c2361c85f0bac891e72e28443465 (patch)
tree264c1da2a55da217579279790116eeed7937258a /src/ir.cpp
parentd0ac9f605d06a2017f577800b098494be95003d0 (diff)
Add message to assert in `ir_build_expr_internal`
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 8bb421daa..4841402f5 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -7939,11 +7939,11 @@ irValue *ir_build_call_expr(irProcedure *proc, Ast *expr) {
irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) {
Ast *original_expr = expr;
expr = unparen_expr(expr);
- // ir_push_debug_location(proc->module, expr, proc->debug_scope);
- // defer (ir_pop_debug_location(proc->module));
+
+ TokenPos expr_pos = ast_token(expr).pos;
TypeAndValue tv = type_and_value_of_expr(expr);
- GB_ASSERT(tv.mode != Addressing_Invalid);
+ GB_ASSERT_MSG(tv.mode != Addressing_Invalid, "invalid expression '%s' @ %.*s(%td:%td)", expr_to_string(expr), LIT(expr_pos.file), expr_pos.line, expr_pos.column);
if (tv.mode == Addressing_Type) {
// HACK TODO(bill): This is hack but it should be safe in virtually all cases
irValue *v = ir_typeid(proc->module, tv.type);