RESOLVED FIXED 202333
Check values of variables before extracting index in perl
https://bugs.webkit.org/show_bug.cgi?id=202333
Summary Check values of variables before extracting index in perl
Paulo Matos
Reported 2019-09-27 14:19:25 PDT
Check values of variables before extracting index in perl
Attachments
Patch (1.40 KB, patch)
2019-09-27 14:21 PDT, Paulo Matos
no flags
Patch (1.78 KB, patch)
2019-10-17 05:39 PDT, Paulo Matos
no flags
Paulo Matos
Comment 1 2019-09-27 14:21:10 PDT
Paulo Matos
Comment 2 2019-09-27 14:24:24 PDT
The problem here is that some gcc versions do not have target or host variables set when built. An example, is gcc-8 from Arch Linux, whose version shows: $ gcc-8 -v Using built-in specs. COLLECT_GCC=gcc-8 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc8/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,fortran,lto --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto --program-suffix=-8 --enable-version-specific-runtime-libs Thread model: posix gcc version 8.3.0 (GCC) This was causing a warning in the perl script because @target[0] and @host[0] are not defined if the regexp fails to match. I noticed the warning while doing: CC=gcc-8 CXX=g++-8 Tools/Scripts/build-jsc --jsc-only --debug
Alexey Proskuryakov
Comment 3 2019-09-28 13:24:31 PDT
Comment on attachment 379766 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379766&action=review > Tools/Scripts/webkitdirs.pm:1393 > + if (!@target || !@host) { This seems worth explaining in a comment. It’s not even clear from bug comments why this situation implies cross-compilation, and it will be even more mysterious without the context.
Paulo Matos
Comment 4 2019-10-17 05:39:12 PDT
Paulo Matos
Comment 5 2019-10-17 05:41:02 PDT
(In reply to Alexey Proskuryakov from comment #3) > Comment on attachment 379766 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=379766&action=review > > > Tools/Scripts/webkitdirs.pm:1393 > > + if (!@target || !@host) { > > This seems worth explaining in a comment. It’s not even clear from bug > comments why this situation implies cross-compilation, and it will be even > more mysterious without the context. Apologies for the delay on this. You are correct that we should not assume cross-compilation, if there's no information about host or target on the compiler version information we assume no cross-compilation. Have now uploaded new patch.
WebKit Commit Bot
Comment 6 2019-10-17 08:15:05 PDT
Comment on attachment 381190 [details] Patch Clearing flags on attachment: 381190 Committed r251234: <https://trac.webkit.org/changeset/251234>
WebKit Commit Bot
Comment 7 2019-10-17 08:15:06 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-10-17 08:16:19 PDT
Note You need to log in before you can comment on or make changes to this bug.