Added an out-of-bounds check

This commit is contained in:
2022-09-09 19:52:36 +01:00
parent f2443fbde0
commit d3c085c300
3 changed files with 32 additions and 2 deletions

View File

@@ -77,6 +77,8 @@ bool setLiteralArray(LiteralArray* array, Literal index, Literal value) {
return false;
}
//TODO: implicit push when referencing one-past-the-end?
freeLiteral(array->literals[idx]);
array->literals[idx] = copyLiteral(value);