1
0

proj/test-return-values: Small fixes

This commit is contained in:
2025-07-28 11:48:55 +02:00
parent ac6f3ead77
commit 3e16cee2f1
2 changed files with 4 additions and 2 deletions

View File

@@ -263,7 +263,7 @@ class Parser:
idx += 1 idx += 1
value = int(value, 0) if value != '(nil)' else 0 value = int(value, 0) if value != '(nil)' else 0
return PointerTo(val, value), idx return PointerTo(val, value), idx
m = re.match(r'[A-Z0-9_]+', argument[idx:]) m = re.match(r'[A-Z0-9_]+|\?', argument[idx:])
if m is not None: if m is not None:
value = m.group(0) value = m.group(0)
idx += len(value) idx += len(value)
@@ -302,6 +302,8 @@ class Parser:
self.pid, self.tid = int(pid), int(tid) self.pid, self.tid = int(pid), int(tid)
if len(self.stack) == 0: if len(self.stack) == 0:
self.stack[(self.pid, self.tid)] = [] self.stack[(self.pid, self.tid)] = []
elif (self.pid, self.tid) not in self.stack:
self.stack[(self.pid, self.tid)] = []
if not data.startswith(b'return ') and not data == b'return': if not data.startswith(b'return ') and not data == b'return':
call = data.decode('utf-8') call = data.decode('utf-8')
#print(f'[{self.pid}][{self.tid}] {call}') #print(f'[{self.pid}][{self.tid}] {call}')

View File

@@ -102,7 +102,7 @@ def main() -> None:
entry[ret] = set() entry[ret] = set()
entry[ret].add(tuple(c for c in iter_tree_ok(child))) entry[ret].add(tuple(c for c in iter_tree_ok(child)))
allowed_cleanup_functions = ['malloc', 'free', 'freeaddrinfo', 'close', 'exit'] allowed_cleanup_functions = ['malloc', 'free', 'freeaddrinfo', 'close', 'exit', 'sigaction']
for call, errors in calls.items(): for call, errors in calls.items():
if len(errors) <= 1: if len(errors) <= 1:
continue continue