[debuginfo-tests] 61d3140 - [dexter] Check path != None before calling os.path.exists
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 15 04:49:52 PDT 2021
Author: OCHyams
Date: 2021-03-15T11:40:05Z
New Revision: 61d314024dc447e49481cb8494bf7165f9ec1323
URL: https://github.com/llvm/llvm-project/commit/61d314024dc447e49481cb8494bf7165f9ec1323
DIFF: https://github.com/llvm/llvm-project/commit/61d314024dc447e49481cb8494bf7165f9ec1323.diff
LOG: [dexter] Check path != None before calling os.path.exists
The test optnone-simple-functions.cpp added in D97668 fails on macOS.
os.path.exists raises an exception because we pass it None. Guard against this.
Related revision: https://reviews.llvm.org/D97668
Added:
Modified:
debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
Removed:
################################################################################
diff --git a/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py b/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
index adac7674aff6..a8e0722579b6 100644
--- a/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
+++ b/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
@@ -27,7 +27,8 @@ def update_step_watches(step_info, watches, commands):
# Iterate over all watches of the types named in watch_cmds
for watch in towatch:
loc = step_info.current_location
- if (os.path.exists(loc.path)
+ if (loc.path != None
+ and os.path.exists(loc.path)
and os.path.samefile(watch.path, loc.path)
and watch.lineno == loc.lineno):
result = watch.eval(step_info)
More information about the llvm-commits
mailing list