diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-03 14:40:56 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-03 14:40:56 -0400 |
| commit | 2b9bec18a4b3f2aa5065489389261583acb1c163 (patch) | |
| tree | 22f0aabb84bfbd04c3c85609120a6b51bebb0f64 /compile.c | |
| parent | b2e752ee3257e967fa4796b39054a7f32629291d (diff) | |
Fix for stride overflows in arrays
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1925,11 +1925,11 @@ CORD compile(env_t *env, ast_t *ast) } else if (streq(call->name, "by")) { CORD self = compile_to_pointer_depth(env, call->self, 0, false); arg_t *arg_spec = new(arg_t, .name="stride", .type=Type(IntType, .bits=64)); - return CORD_all("Array$by(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ")"); + return CORD_all("Array$by(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ", ", compile_type_info(env, self_value_t), ")"); } else if (streq(call->name, "reversed")) { CORD self = compile_to_pointer_depth(env, call->self, 0, false); (void)compile_arguments(env, ast, NULL, call->args); - return CORD_all("Array$reversed(", self, ")"); + return CORD_all("Array$reversed(", self, ", ", compile_type_info(env, self_value_t), ")"); } else code_err(ast, "There is no '%s' method for arrays", call->name); } case TableType: { |
