Commit 10fb0322 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

SuperSize: Fix incorrect padding when loading .sizediff

Bug: 1130584
Change-Id: I0ad7e220c67f7af029f3e1a4656a832d124b4b0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422119
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808937}
parent 8423272c
......@@ -405,7 +405,9 @@ void ParseSizeInfo(const char* gzipped, unsigned long len, SizeInfo* info) {
new_sym.size_ = cur_sizes[i];
if (has_padding) {
new_sym.padding_ = cur_paddings[i];
new_sym.size_ += new_sym.padding_;
if (!new_sym.IsOverhead()) {
new_sym.size_ += new_sym.padding_;
}
}
new_sym.section_name_ = cur_section_name;
new_sym.object_path_ = info->object_paths[cur_path_indices[i]];
......
......@@ -557,10 +557,10 @@ def _LoadSizeInfoFromFile(file_obj, size_path):
# Derived.
if cur_paddings:
new_sym.padding = cur_paddings[i]
new_sym.size += new_sym.padding
if not new_sym.IsOverhead():
new_sym.size += new_sym.padding
else:
# This will be computed during CreateSizeInfo().
new_sym.padding = 0
new_sym.padding = 0 # Computed below.
new_sym.template_name = ''
new_sym.name = ''
......
......@@ -352,9 +352,11 @@ class IntegrationTest(unittest.TestCase):
def test_Archive_Elf_DebugMeasures(self):
return self._DoArchiveTest(use_elf=True, debug_measures=True)
@_CompareWithGolden(name='Archive')
@_CompareWithGolden(name='Archive_Apk')
def test_ArchiveSparse(self):
return self._DoArchiveTest(use_output_directory=False, include_padding=True)
return self._DoArchiveTest(use_apk=True,
use_aux_elf=True,
include_padding=True)
@_CompareWithGolden()
def test_Console(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment