diff --git a/pykd/windbgext.cpp b/pykd/windbgext.cpp index 251e8d6..d71cb9a 100644 --- a/pykd/windbgext.cpp +++ b/pykd/windbgext.cpp @@ -195,7 +195,7 @@ public: Py_INCREF(threadState->interp->codec_error_registry); PyThreadState_Swap(threadState); - } + } private: @@ -264,7 +264,7 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdExt, py) args.erase( foundArg ); } - if ( global & local ) + if ( global && local ) { eprintln( L"-g(--global) and -l(--local) cannot be set together" ); return; @@ -281,11 +281,11 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdExt, py) return; } - global = !(global | local ) ? false : global ; //set local by default + global = !(global || local ) ? false : global ; //set local by default } else { - global = !(global | local ) ? true : global ; //set global by default + global = !(global || local ) ? true : global ; //set global by default } PyThreadState *localState = NULL; diff --git a/test/scripts/typeinfo.py b/test/scripts/typeinfo.py index 1dbce0b..63f5c86 100644 --- a/test/scripts/typeinfo.py +++ b/test/scripts/typeinfo.py @@ -239,6 +239,13 @@ class TypeInfoTest( unittest.TestCase ): def testArrayOf(self): ti = pykd.typeInfo("UInt8B").arrayOf(10) self.assertTrue( "UInt8B[10]", ti.name() ) + + def testCompareWihNone(self): + ti = None + if ti == None: + ti = pykd.typeInfo("UInt8B") + if ti == None: + pass def testFunction(self): functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref()