diff options
author | Yan Wang <yawanng@google.com> | 2019-09-11 14:08:24 -0700 |
---|---|---|
committer | Yan Wang <yawanng@google.com> | 2019-09-11 14:08:24 -0700 |
commit | 90c2b028dc64bb638b3fba3e10124abde4e58761 (patch) | |
tree | 0aae46c2277c1dcbda067356c6a76719fad3532c | |
parent | 68655ec636b52e44b5f1e8145420a2370b108274 (diff) |
startop: Fix the if condition to prevent duplicate filename for file id
0 in host compiler.
Test: pytest
Bug: 140655545
Change-Id: I952db4cf06060483cfcf8e42352324ad0d710d3b
-rwxr-xr-x | startop/scripts/iorap/compiler_ri.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/startop/scripts/iorap/compiler_ri.py b/startop/scripts/iorap/compiler_ri.py index 17b58c19ef28..90fc8a8123c5 100755 --- a/startop/scripts/iorap/compiler_ri.py +++ b/startop/scripts/iorap/compiler_ri.py @@ -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 |