disable realpath & mprotect for wasm
This commit is contained in:
parent
377b38b84f
commit
b60bc7c3bf
@ -157,6 +157,9 @@ B path_name(B path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
B path_abs(B path) {
|
B path_abs(B path) {
|
||||||
|
#if WASM
|
||||||
|
return path; // lazy
|
||||||
|
#else
|
||||||
if (q_N(path)) return path;
|
if (q_N(path)) return path;
|
||||||
u64 plen = utf8lenB(path);
|
u64 plen = utf8lenB(path);
|
||||||
TALLOC(char, p, plen+1);
|
TALLOC(char, p, plen+1);
|
||||||
@ -169,6 +172,7 @@ B path_abs(B path) {
|
|||||||
dec(path);
|
dec(path);
|
||||||
TFREE(p);
|
TFREE(p);
|
||||||
return r;
|
return r;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
src/vm.c
2
src/vm.c
@ -978,7 +978,9 @@ static void allocStack(void** curr, void** start, void** end, i32 elSize, i32 co
|
|||||||
assert(sz%elSize == 0);
|
assert(sz%elSize == 0);
|
||||||
*curr = *start = mmap(NULL, sz+ps, PROT_READ|PROT_WRITE, MAP_NORESERVE|MAP_PRIVATE|MAP_ANON, -1, 0);
|
*curr = *start = mmap(NULL, sz+ps, PROT_READ|PROT_WRITE, MAP_NORESERVE|MAP_PRIVATE|MAP_ANON, -1, 0);
|
||||||
*end = ((char*)*start)+sz;
|
*end = ((char*)*start)+sz;
|
||||||
|
#if !WASM
|
||||||
mprotect(*end, ps, PROT_NONE); // idk first way i found to force erroring on overflow
|
mprotect(*end, ps, PROT_NONE); // idk first way i found to force erroring on overflow
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void print_vmStack() {
|
void print_vmStack() {
|
||||||
#ifdef DEBUG_VM
|
#ifdef DEBUG_VM
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user