blueloveTH 2 anos atrás
pai
commit
6c821f35ea
2 arquivos alterados com 5 adições e 2 exclusões
  1. 1 1
      include/pocketpy/common.h
  2. 4 1
      src/ceval.cpp

+ 1 - 1
include/pocketpy/common.h

@@ -22,7 +22,7 @@
 #include <random>
 #include <random>
 #include <bitset>
 #include <bitset>
 
 
-#define PK_VERSION				"1.2.5"
+#define PK_VERSION				"1.2.6"
 
 
 #include "config.h"
 #include "config.h"
 #include "export.h"
 #include "export.h"

+ 4 - 1
src/ceval.cpp

@@ -577,7 +577,10 @@ __NEXT_STEP:;
         TOP() = py_negate(TOP());
         TOP() = py_negate(TOP());
         DISPATCH();
         DISPATCH();
     TARGET(UNARY_NOT)
     TARGET(UNARY_NOT)
-        TOP() = VAR(!py_bool(TOP()));
+        _0 = TOP();
+        if(_0==True) TOP()=False;
+        else if(_0==False) TOP()=True;
+        else TOP() = VAR(!py_bool(_0));
         DISPATCH();
         DISPATCH();
     TARGET(UNARY_STAR)
     TARGET(UNARY_STAR)
         TOP() = VAR(StarWrapper(byte.arg, TOP()));
         TOP() = VAR(StarWrapper(byte.arg, TOP()));