[wasm] Fix test_0_conv_i under interp.
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 26 Sep 2017 00:01:37 +0000 (17:01 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 26 Sep 2017 00:01:37 +0000 (17:01 -0700)
mono/mini/interp/interp.c

index 42b91954fcf2c223e6c66a23fd404544ff3cb88b..412145683039727b6c053676cf346110372960a3 100644 (file)
@@ -3442,6 +3442,9 @@ ves_exec_method_with_context (InterpFrame *frame, ThreadContext *context, unsign
                        /* needed on arm64 */
                        if (isinf (sp [-1].data.f))
                                sp [-1].data.i = 0;
+                       /* needed by wasm */
+                       else if (isnan (sp [-1].data.f))
+                               sp [-1].data.i = 0;
                        else
                                sp [-1].data.i = (guint32)sp [-1].data.f;
                        ++ip;