disable realpath & mprotect for wasm

This commit is contained in:
dzaima 2022-04-06 19:16:35 +03:00
parent 377b38b84f
commit b60bc7c3bf
2 changed files with 6 additions and 0 deletions

View File

@ -157,6 +157,9 @@ B path_name(B path) {
}
B path_abs(B path) {
#if WASM
return path; // lazy
#else
if (q_N(path)) return path;
u64 plen = utf8lenB(path);
TALLOC(char, p, plen+1);
@ -169,6 +172,7 @@ B path_abs(B path) {
dec(path);
TFREE(p);
return r;
#endif
}

View File

@ -978,7 +978,9 @@ static void allocStack(void** curr, void** start, void** end, i32 elSize, i32 co
assert(sz%elSize == 0);
*curr = *start = mmap(NULL, sz+ps, PROT_READ|PROT_WRITE, MAP_NORESERVE|MAP_PRIVATE|MAP_ANON, -1, 0);
*end = ((char*)*start)+sz;
#if !WASM
mprotect(*end, ps, PROT_NONE); // idk first way i found to force erroring on overflow
#endif
}
void print_vmStack() {
#ifdef DEBUG_VM