diff options
| author | Peter LaFosse <peter@vector35.com> | 2017-02-09 12:02:47 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2017-02-09 12:16:58 -0500 |
| commit | 5ee2b21b91035ba37b345d6045ec93c33225e93c (patch) | |
| tree | 766af764e0c1e876dc52249e01daa338f63143c9 /python/function.py | |
| parent | ecb848f7cedeecf033f283df0b7d1fa8aca80d50 (diff) | |
Fix highlight API's to work with HighlightStandardColor properly
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/function.py b/python/function.py index 7d03585c..9b00eec2 100644 --- a/python/function.py +++ b/python/function.py @@ -764,7 +764,9 @@ class Function(object): """ if arch is None: arch = self.arch - if not isinstance(color, highlight.HighlightColor): + if not isinstance(color, HighlightStandardColor) and not isinstance(color, highlight.HighlightColor): + raise ValueError("Specified color is not one of HighlightStandardColor, highlight.HighlightColor") + if isinstance(color, HighlightStandardColor): color = highlight.HighlightColor(color = color) core.BNSetAutoInstructionHighlight(self.handle, arch.handle, addr, color._get_core_struct()) @@ -784,6 +786,8 @@ class Function(object): arch = self.arch if not isinstance(color, HighlightStandardColor) and not isinstance(color, highlight.HighlightColor): raise ValueError("Specified color is not one of HighlightStandardColor, highlight.HighlightColor") + if isinstance(color, HighlightStandardColor): + color = highlight.HighlightColor(color) core.BNSetUserInstructionHighlight(self.handle, arch.handle, addr, color._get_core_struct()) |
