wasm initializes all variables to 0, so manually setting them to 0 is not
necessary.

On Tue, Nov 15, 2016 at 6:17 AM, Даниил Оношко <[email protected]> wrote:

> Solved:
>
> how asm2wasm works:
>
> var i = 0; // int
> var j = 0; // int
> var p1 = 0.0; // double
> var pt = 0.0; // double
> var r = 0.0; // double
> var ntp = 0; // init
>
> translates to
>
>     (local $i i32)
>     (local $j i32)
>     (local $p1 f64)
>     (local $pt f64)
>     (local $r f64)
>     (local $ntp i32)
>
> but should:
>
>
>     (local $i i32)
>     (local $j i32)
>     (local $p1 f64)
>     (local $pt f64)
>     (local $r f64)
>     (local $ntp i32)
>     (set_local $i
>       (i32.const 0)
>     )
>     (set_local $j
>       (i32.const 0)
>     )
>     (set_local $p1
>       (f64.const 0)
>     )
>     (set_local $pt
>       (f64.const 0)
>     )
>     (set_local $r
>       (f64.const 0)
>     )
>     (set_local $ntp
>       (i32.const 25)
>     )
>
> and i solve my problem with:
>
>
> var i = 0; // int
> var j = 0; // int
> var p1 = 0.0; // double
> var pt = 0.0; // double
> var r = 0.0; // double
> var ntp = 0; // init
> i = 0; // int
> j = 0; // int
> p1 = 0.0; // double
> pt = 0.0; // double
> r = 0.0; // double
> ntp = 25;
>
> вторник, 15 ноября 2016 г., 20:45:22 UTC+7 пользователь Даниил Оношко
> написал:
>>
>> I have some asmjs module and I compile it into wasm with asm2wasm and
>> s2wasm, but I don't understand how I should create "memory", Chrome every
>> time throw this error: "RuntimeError: memory access out of bounds".
>>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to