Commit e4746dc1 authored by Matthew Fernandez's avatar Matthew Fernandez
Browse files

fix: account for Quantifier::decl when choosing a ValueType

Consider a range-based for loop:

  for i := 0 to 10 do
    ...
  end;

The variable used for i is constructed as an unbounded Range type. The bounds
for this default to [INT64_MIN, INT64_MAX] currently. By not taking this into
account, the logic that automatically selects a value_t was sometimes choosing a
smaller type (e.g. uint8_t). This resulting in reading and writing a handle that
exceed the width of value_t. This causes an assertion failure in debug mode and
incorrect optimisation in non-debug mode.

This is not yet a complete fix. We also need to more precisely bound the type of
the loop variable itself, as its width will currently always exceed the width of
value_t.
parent ae61e382
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment