Don't use PRIkrk_int in exception format strings, we can't trust it

This commit is contained in:
K. Lange 2022-08-01 11:22:33 +09:00
parent 5190c0c9ab
commit efb73c8759
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@
#define LIST_WRAP_INDEX() \
if (index < 0) index += self->values.count; \
if (unlikely(index < 0 || index >= (krk_integer_type)self->values.count)) return krk_runtimeError(vm.exceptions->indexError, "list index out of range: " PRIkrk_int, index)
if (unlikely(index < 0 || index >= (krk_integer_type)self->values.count)) return krk_runtimeError(vm.exceptions->indexError, "list index out of range: %zd", (ssize_t)index)
#define LIST_WRAP_SOFT(val) \
if (val < 0) val += self->values.count; \

View File

@ -7,7 +7,7 @@
#define TUPLE_WRAP_INDEX() \
if (index < 0) index += self->values.count; \
if (index < 0 || index >= (krk_integer_type)self->values.count) return krk_runtimeError(vm.exceptions->indexError, "tuple index out of range: " PRIkrk_int, index)
if (index < 0 || index >= (krk_integer_type)self->values.count) return krk_runtimeError(vm.exceptions->indexError, "tuple index out of range: %zd", (ssize_t)index)
static int _tuple_init_callback(void * context, const KrkValue * values, size_t count) {
KrkValueArray * positionals = context;