3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-22 08:17:37 +00:00

Fix Priority 1 ASSERT_FAIL bugs - replace assertions with proper error handling

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-18 00:42:55 +00:00
parent ac19bdb9a7
commit ae328dc006
4 changed files with 43 additions and 25 deletions

View file

@ -3594,10 +3594,11 @@ class MakeRuleCmd(object):
def strip_path_prefix(path, prefix):
if path.startswith(prefix):
stripped_path = path[len(prefix):]
stripped_path.replace('//','/')
if stripped_path[0] == '/':
stripped_path = stripped_path.replace('//','/')
if len(stripped_path) > 0 and stripped_path[0] == '/':
stripped_path = stripped_path[1:]
assert not os.path.isabs(stripped_path)
if os.path.isabs(stripped_path):
raise ValueError(f"Path '{path}' after stripping prefix '{prefix}' is still absolute: '{stripped_path}'")
return stripped_path
else:
return path