Emit an error when trying to inline a mutable variable

This commit is contained in:
dcodeIO
2018-07-19 16:38:09 +02:00
parent fafaf423b4
commit 66cc359849
2 changed files with 20 additions and 8 deletions

View File

@ -14,8 +14,7 @@ var offset: usize = startOffset;
// Memory allocator interface
@global
export function __memory_allocate(size: usize): usize {
@global export function __memory_allocate(size: usize): usize {
if (size) {
if (size > MAX_SIZE_32) unreachable();
let ptr = offset;
@ -36,10 +35,8 @@ export function __memory_allocate(size: usize): usize {
return 0;
}
@global
export function __memory_free(ptr: usize): void { /* nop */ }
@global export function __memory_free(ptr: usize): void { /* nop */ }
@global
export function __memory_reset(): void {
@global export function __memory_reset(): void {
offset = startOffset;
}