mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-26 15:32:16 +00:00
Properly set up memory if memoryBase is specified even if there are no static segments, fixes #414
This commit is contained in:
parent
201bd5f2b1
commit
2aa5c437c7
@ -392,12 +392,11 @@ export class Compiler extends DiagnosticEmitter {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// determine initial page size
|
// set up memory
|
||||||
var numPages = this.memorySegments.length
|
|
||||||
? i64_low(i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0)))
|
|
||||||
: 0;
|
|
||||||
module.setMemory(
|
module.setMemory(
|
||||||
numPages,
|
this.options.memoryBase /* is specified */ || this.memorySegments.length
|
||||||
|
? i64_low(i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0)))
|
||||||
|
: 0,
|
||||||
Module.UNLIMITED_MEMORY,
|
Module.UNLIMITED_MEMORY,
|
||||||
this.memorySegments,
|
this.memorySegments,
|
||||||
options.target,
|
options.target,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user