Hi guys,

i have a question concerning webassembly,
please let me know if this is the wrong list.

is it possible to use classes and compile to webassemly,
the following code is working well but wen i uncomment the constructor line
the code can be compiled but will not run anymore

RuntimeError: memory access out of bounds

is the result

i compile with the following command

ppcrosswasm32 -Twasi -oadd.wasm add.pas


------------
library add;

{$mode objfpc}

type
  TConnection = class
  private
    n : Integer;
  public
    constructor Create;
  end;

constructor TConnection.Create;
begin
  n := 4711;
end;

function add( a1, a2 : Integer ) : Integer;
var
  connection : TConnection;
begin
  //connection := TConnection.Create;
  Result := 4711;
end;

exports
  add name 'add';
end.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to