Wenyong Huang 4 лет назад
Родитель
Сommit
310feb6536
2 измененных файлов с 7 добавлено и 5 удалено
  1. 1 2
      core/iwasm/aot/aot_intrinsic.h
  2. 6 3
      core/shared/platform/common/math/math.c

+ 1 - 2
core/iwasm/aot/aot_intrinsic.h

@@ -6,12 +6,11 @@
 #ifndef _AOT_INTRINSIC_H
 #define _AOT_INTRINSIC_H
 
+#include "aot_runtime.h"
 #if WASM_ENABLE_WAMR_COMPILER != 0
 #include "aot_llvm.h"
 #endif
 
-#include "aot_runtime.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif

+ 6 - 3
core/shared/platform/common/math/math.c

@@ -534,7 +534,8 @@ static double freebsd_atan2(double y, double x)
 		case 0:
 		case 1: return y; 	/* atan(+-0,+anything)=+-0 */
 		case 2: return  pi+tiny;/* atan(+0,-anything) = pi */
-		case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
+		case 3:
+		default: return -pi-tiny;/* atan(-0,-anything) =-pi */
 	    }
 	}
     /* when x = 0 */
@@ -547,14 +548,16 @@ static double freebsd_atan2(double y, double x)
 		    case 0: return  pi_o_4+tiny;/* atan(+INF,+INF) */
 		    case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
 		    case 2: return  3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/
-		    case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/
+		    case 3:
+		    default: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/
 		}
 	    } else {
 		switch(m) {
 		    case 0: return  zero  ;	/* atan(+...,+INF) */
 		    case 1: return -zero  ;	/* atan(-...,+INF) */
 		    case 2: return  pi+tiny  ;	/* atan(+...,-INF) */
-		    case 3: return -pi-tiny  ;	/* atan(-...,-INF) */
+		    case 3:
+		    default: return -pi-tiny  ;	/* atan(-...,-INF) */
 		}
 	    }
 	}