From cdbdbef6e3b67fd26a1c9b8fd52c7bfc68d98620 Mon Sep 17 00:00:00 2001 From: Mike Welsh Date: Mon, 27 May 2013 22:57:00 -0400 Subject: [PATCH] Fix comparison against NaN --- vm/others.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vm/others.c b/vm/others.c index be07ccbe..530d867a 100644 --- a/vm/others.c +++ b/vm/others.c @@ -42,6 +42,7 @@ static INLINE int icmp( int a, int b ) { } static INLINE int fcmp( tfloat a, tfloat b ) { + if(a != a || b != b) return invalid_comparison; return (a == b)?0:((a < b)?-1:1); }