startop: Fix the if condition to prevent duplicate filename for file id

0 in host compiler.

Test: pytest
Bug: 140655545
Change-Id: I952db4cf06060483cfcf8e42352324ad0d710d3b
This commit is contained in:
Yan Wang
2019-09-11 14:08:24 -07:00
parent 68655ec636
commit 90c2b028dc

View File

@@ -139,7 +139,9 @@ def build_protobuf(page_runs, inode2filename, filters=[]):
continue
file_id = file_id_map.get(filename)
if not file_id:
# file_id could 0, which satisfies "if file_id" and causes duplicate
# filename for file id 0.
if file_id is None:
file_id = file_id_counter
file_id_map[filename] = file_id_counter
file_id_counter = file_id_counter + 1