summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xllvm/utils/opt-viewer/opt-viewer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/opt-viewer/opt-viewer.py b/llvm/utils/opt-viewer/opt-viewer.py
index d56e295425f..597c7031069 100755
--- a/llvm/utils/opt-viewer/opt-viewer.py
+++ b/llvm/utils/opt-viewer/opt-viewer.py
@@ -217,7 +217,7 @@ class SourceFileRenderer:
# Column is the number of characters *including* tabs, keep those and
# replace everything else with spaces.
- indent = line[:r.Column - 1]
+ indent = line[:max(r.Column, 1) - 1]
indent = re.sub('\S', ' ', indent)
print('''
OpenPOWER on IntegriCloud