mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 07:02:13 +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
|
||||
var numPages = this.memorySegments.length
|
||||
? i64_low(i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0)))
|
||||
: 0;
|
||||
// set up memory
|
||||
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,
|
||||
this.memorySegments,
|
||||
options.target,
|
||||
|
Loading…
x
Reference in New Issue
Block a user