aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_execution.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'parse_execution.cpp')
-rw-r--r--parse_execution.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse_execution.cpp b/parse_execution.cpp
index 9267fb79..484d8741 100644
--- a/parse_execution.cpp
+++ b/parse_execution.cpp
@@ -72,7 +72,8 @@ node_offset_t parse_execution_context_t::get_offset(const parse_node_t &node) co
const parse_node_t *addr = &node;
const parse_node_t *base = &this->tree.at(0);
assert(addr >= base);
- node_offset_t offset = addr - base;
+ assert(addr - base < SOURCE_OFFSET_INVALID);
+ node_offset_t offset = static_cast<node_offset_t>(addr - base);
assert(offset < this->tree.size());
assert(&tree.at(offset) == &node);
return offset;