Browse Source

[PATCH 46/83] making global variables mutable

From 91b09870154fb8a881f780d29ca41e2ac31e12dc Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Thu, 19 Sep 2019 17:06:56 -0400

git-svn-id: branches/wasm@45923 -
nickysn 5 years ago
parent
commit
210c0e2d10
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/wasm/agwat.pas

+ 2 - 2
compiler/wasm/agwat.pas

@@ -554,7 +554,7 @@ implementation
         end;
         writer.MarkEmpty;
         writer.AsmWriteLn('(module ');
-        writer.AsmWriteLn('(memory 32768) ;; todo: this should be imported or based on the directives ');
+        writer.AsmWriteLn('(import "env" "memory" (memory 0)) ;;');
 
         { print all global variables }
         //current_asmdata.AsmSymbolDict
@@ -636,7 +636,7 @@ implementation
                  writer.AsmWrite(#9);
                  writer.AsmWrite('(global $');
                  writer.AsmWrite(tcpustaticvarsym(sym).mangledname);
-                 writer.AsmWrite(' i32 (i32.const ');
+                 writer.AsmWrite(' (mut i32) (i32.const ');
                  writer.AsmWrite( tostr(sz));
                  writer.AsmWrite(')');
                  writer.AsmWrite(') ');