fix vm_fmtPoint on non-equal s and src types
This commit is contained in:
parent
167351bdba
commit
a56a20b046
@ -591,4 +591,8 @@ NOINLINE void printAllocStats() {
|
||||
}
|
||||
return x;
|
||||
}
|
||||
NOINLINE NORETURN void assert_fail(char* expr, char* file, int line, const char fn[]) {
|
||||
printf("%s:%d: %s: Assertion `%s` failed.\n", file, line, fn, expr);
|
||||
err("");
|
||||
}
|
||||
#endif
|
||||
|
||||
3
src/h.h
3
src/h.h
@ -207,7 +207,8 @@ typedef struct Arr {
|
||||
} Arr;
|
||||
|
||||
#ifdef DEBUG
|
||||
#include<assert.h>
|
||||
NOINLINE NORETURN void assert_fail(char* expr, char* file, int line, const char fn[]);
|
||||
#define assert(X) do { if (!(X)) assert_fail(#X, __FILE__, __LINE__, __PRETTY_FUNCTION__); } while (0)
|
||||
B VALIDATE(B x);
|
||||
Value* VALIDATEP(Value* x);
|
||||
#define UD assert(false);
|
||||
|
||||
3
src/vm.c
3
src/vm.c
@ -998,7 +998,8 @@ NOINLINE B vm_fmtPoint(B src, B prepend, B path, usz cs, usz ce) { // consumes p
|
||||
else AFMT("at ");
|
||||
i64 padEnd = (i64)a(s)->ia;
|
||||
i64 padStart = padEnd;
|
||||
while (padStart>0 && o2cu(srcGetU(s,padStart-1))!='\n') padStart--;
|
||||
BS2B sGetU = TI(s,getU);
|
||||
while (padStart>0 && o2cu(sGetU(s,padStart-1))!='\n') padStart--;
|
||||
|
||||
Arr* slice = TI(src,slice)(inc(src),srcS, srcE-srcS); arr_shVec(slice);
|
||||
AJOIN(taga(slice));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user