浏览代码

Add a type check before try to set an enum value as integer

mingodad 7 年之前
父节点
当前提交
1d62218bab
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      SquiLu/squirrel/sqcompiler.cpp

+ 1 - 1
SquiLu/squirrel/sqcompiler.cpp

@@ -2981,7 +2981,7 @@ error:
             {
                 Lex();
                 val = ExpectScalar();
-                nval = _integer(val)+1;
+                if(sq_type(val) == OT_INTEGER) nval = _integer(val)+1;
             }
             else
             {