[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
This commit is contained in:
OCHyams 2021-03-15 11:28:28 +00:00
parent 0df28acffb
commit 61d314024d
1 changed files with 2 additions and 1 deletions

View File

@ -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)