Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scoping of temporary variables in Darwin codegen. #15123

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

When converting a C++ DecodableList into an Objective C NSArray, we
declare some temporary variables. These were not scoped in their own
scope, so if multiple lists were decoded at the same nesting level
(e.g. two list-typed members of the same struct), the names would
collide and produce compile errors.

The fix is to just scope the entire conversion.

Problem

See above.

Change overview

See above.

Testing

Compiled #15025 successfully with this fix applied on top of it.

When converting a C++ DecodableList into an Objective C NSArray, we
declare some temporary variables.  These were not scoped in their own
scope, so if multiple lists were decoded at the same nesting level
(e.g. two list-typed members of the same struct), the names would
collide and produce compile errors.

The fix is to just scope the entire conversion.
@github-actions
Copy link

github-actions bot commented Feb 12, 2022

PR #15123: Size comparison from cb432c8 to 1898991

Full report (43 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section cb432c8 1898991 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 592390 592390 0 0.0
.app_xip_area 497868 497868 0 0.0
.bss 77220 77220 0 0.0
.data 644 644 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 550446 550446 0 0.0
.app_xip_area 457492 457492 0 0.0
.bss 75692 75692 0 0.0
.data 608 608 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 569074 569074 0 0.0
.app_xip_area 466864 466864 0 0.0
.bss 84620 84620 0 0.0
.data 552 552 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 908448 908448 0 0.0
(read/write) 127384 127384 0 0.0
.bss 125352 125352 0 0.0
.data 2032 2032 0 0.0
.text 908440 908440 0 0.0
BRD4161A+rpc (read only) 937160 937160 0 0.0
(read/write) 144304 144304 0 0.0
.bss 142128 142128 0 0.0
.data 2172 2172 0 0.0
.text 937152 937152 0 0.0
window-app BRD4161A (read only) 843668 843668 0 0.0
(read/write) 125444 125444 0 0.0
.bss 123544 123544 0 0.0
.data 1900 1900 0 0.0
.text 843660 843660 0 0.0
esp32 all-clusters-app c3devkit (read only) 944592 944592 0 0.0
(read/write) 1398578 1398578 0 0.0
.dram0.bss 66408 66408 0 0.0
.dram0.data 14268 14268 0 0.0
.flash.rodata 199000 199000 0 0.0
.flash.text 944592 944592 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 994535 994535 0 0.0
(read/write) 463856 463856 0 0.0
.dram0.bss 71552 71552 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 226112 226112 0 0.0
.flash.text 989151 989151 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 682988 682988 0 0.0
.bss 76656 76656 0 0.0
.data 1904 1904 0 0.0
.text 598628 598628 0 0.0
lock k32w061+release (read/write) 688412 688412 0 0.0
.bss 77048 77048 0 0.0
.data 1948 1948 0 0.0
.text 603616 603616 0 0.0
linux all-clusters-app debug (read only) 2355657 2355657 0 0.0
(read/write) 140000 140000 0 0.0
.bss 54528 54528 0 0.0
.data 1296 1296 0 0.0
.data.rel.ro 78504 78504 0 0.0
.dynamic 592 592 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 205765 205765 0 0.0
.text 1987618 1987618 0 0.0
bridge-app debug+rpc (read only) 1724741 1724741 0 0.0
(read/write) 84200 84200 0 0.0
.bss 38928 38928 0 0.0
.data 2034 2034 0 0.0
.data.rel.ro 38064 38064 0 0.0
.dynamic 592 592 0 0.0
.got 3976 3976 0 0.0
.init 27 27 0 0.0
.init_array 560 560 0 0.0
.rodata 141644 141644 0 0.0
.text 1466549 1466549 0 0.0
chip-tool debug (read only) 8434061 8434061 0 0.0
(read/write) 245696 245696 0 0.0
.bss 32200 32200 0 0.0
.data 1184 1184 0 0.0
.data.rel.ro 206280 206280 0 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 459541 459541 0 0.0
.text 7459125 7459125 0 0.0
chip-tool-ipv6only arm64 (read only) 8237812 8237812 0 0.0
(read/write) 353233 353233 0 0.0
.bss 50497 50497 0 0.0
.data 1216 1216 0 0.0
.data.rel.ro 248720 248720 0 0.0
.dynamic 560 560 0 0.0
.got 49008 49008 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 435724 435724 0 0.0
.text 7041188 7041188 0 0.0
door-lock-app debug (read only) 1929897 1929897 0 0.0
(read/write) 110488 110488 0 0.0
.bss 42000 42000 0 0.0
.data 1010 1010 0 0.0
.data.rel.ro 62064 62064 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 173042 173042 0 0.0
.text 1608338 1608338 0 0.0
lighting-app debug+rpc (read only) 2053545 2053545 0 0.0
(read/write) 115736 115736 0 0.0
.bss 43008 43008 0 0.0
.data 1400 1400 0 0.0
.data.rel.ro 65816 65816 0 0.0
.dynamic 608 608 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 165361 165361 0 0.0
.text 1733442 1733442 0 0.0
ota-provider-app debug (read only) 1863545 1863545 0 0.0
(read/write) 106200 106200 0 0.0
.bss 41856 41856 0 0.0
.data 1224 1224 0 0.0
.data.rel.ro 57464 57464 0 0.0
.dynamic 608 608 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 157611 157611 0 0.0
.text 1555346 1555346 0 0.0
ota-requestor-app debug (read only) 1858873 1858873 0 0.0
(read/write) 107256 107256 0 0.0
.bss 42144 42144 0 0.0
.data 1160 1160 0 0.0
.data.rel.ro 58520 58520 0 0.0
.dynamic 592 592 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 151164 151164 0 0.0
.text 1558866 1558866 0 0.0
shell debug (read only) 2340017 2340017 0 0.0
(read/write) 141488 141488 0 0.0
.bss 61792 61792 0 0.0
.data 832 832 0 0.0
.data.rel.ro 73184 73184 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 206642 206642 0 0.0
.text 1976594 1976594 0 0.0
thermostat-no-ble arm64 (read only) 2149468 2149468 0 0.0
(read/write) 140657 140657 0 0.0
.bss 57521 57521 0 0.0
.data 1032 1032 0 0.0
.data.rel.ro 75000 75000 0 0.0
.dynamic 560 560 0 0.0
.got 4144 4144 0 0.0
.init 24 24 0 0.0
.init_array 328 328 0 0.0
.rodata 132892 132892 0 0.0
.text 1798384 1798384 0 0.0
tv-app debug (read only) 2527617 2527617 0 0.0
(read/write) 139392 139392 0 0.0
.bss 57152 57152 0 0.0
.data 3200 3200 0 0.0
.data.rel.ro 73008 73008 0 0.0
.dynamic 592 592 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 197637 197637 0 0.0
.text 2157010 2157010 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2397760 2397760 0 0.0
.bss 188476 188476 0 0.0
.data 5320 5320 0 0.0
.text 1360360 1360360 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2359984 2359984 0 0.0
.bss 181088 181088 0 0.0
.data 5624 5624 0 0.0
.text 1322584 1322584 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2323520 2323520 0 0.0
.bss 180976 180976 0 0.0
.data 5600 5600 0 0.0
.text 1286120 1286120 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139648 1139648 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103032 103032 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2308668 2308668 0 0.0
.bss 178228 178228 0 0.0
.data 5424 5424 0 0.0
.text 1271240 1271240 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1015339 1015339 0 0.0
bss 121412 121412 0 0.0
rodata 120056 120056 0 0.0
text 694920 694920 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 984615 984615 0 0.0
bss 118600 118600 0 0.0
rodata 111580 111580 0 0.0
text 674808 674808 0 0.0
nrf52840dongle_nrf52840 (read/write) 1031231 1031231 0 0.0
bss 122800 122800 0 0.0
rodata 118936 118936 0 0.0
text 699556 699556 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 921998 921998 0 0.0
bss 117976 117976 0 0.0
rodata 113296 113296 0 0.0
text 609944 609944 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 945099 945099 0 0.0
bss 119784 119784 0 0.0
rodata 108816 108816 0 0.0
text 637968 637968 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 852626 852626 0 0.0
bss 116376 116376 0 0.0
rodata 101988 101988 0 0.0
text 553768 553768 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 527595 527595 0 0.0
bss 53632 53632 0 0.0
rodata 49976 49976 0 0.0
text 361016 361016 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 943903 943903 0 0.0
bss 119504 119504 0 0.0
rodata 107772 107772 0 0.0
text 638024 638024 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 939863 939863 0 0.0
bss 119508 119508 0 0.0
rodata 107468 107468 0 0.0
text 634264 634264 0 0.0
shell nrf52840dk_nrf52840 (read/write) 806767 806767 0 0.0
bss 111216 111216 0 0.0
rodata 79092 79092 0 0.0
text 538872 538872 0 0.0
p6 all-clusters-app default (read/write) 2482408 2482408 0 0.0
.bss 117744 117744 0 0.0
.data 2672 2672 0 0.0
.text 1440672 1440672 0 0.0
light-app default (read/write) 2389240 2389240 0 0.0
.bss 107392 107392 0 0.0
.data 2520 2520 0 0.0
.text 1347504 1347504 0 0.0
lock-app default (read/write) 2352720 2352720 0 0.0
.bss 107112 107112 0 0.0
.data 2480 2480 0 0.0
.text 1310984 1310984 0 0.0
qpg lighting-app qpg6105+debug (read only) 594628 594628 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88936 88936 0 0.0
.data 1108 1108 0 0.0
.text 589308 589308 0 0.0
lock-app qpg6105+debug (read only) 560356 560356 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88920 88920 0 0.0
.data 1060 1060 0 0.0
.text 555036 555036 0 0.0
persistent-storage-app qpg6105+debug (read only) 99520 99520 0 0.0
(read/write) 146940 146940 0 0.0
.bss 24004 24004 0 0.0
.data 176 176 0 0.0
.text 94200 94200 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 874330 874330 0 0.0
bss 88736 88736 0 0.0
noinit 37160 37160 0 0.0
text 614094 614094 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit 9c42108 into project-chip:master Feb 12, 2022
@bzbarsky-apple bzbarsky-apple deleted the fix-darwin-codegen-scoping branch February 12, 2022 23:26
jamesluo11 pushed a commit to jamesluo11/connectedhomeip that referenced this pull request Apr 26, 2022
…5123)

When converting a C++ DecodableList into an Objective C NSArray, we
declare some temporary variables.  These were not scoped in their own
scope, so if multiple lists were decoded at the same nesting level
(e.g. two list-typed members of the same struct), the names would
collide and produce compile errors.

The fix is to just scope the entire conversion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants