WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
196343
Opcode.h(159,27): warning: adding 'unsigned int' to a string does not append to the string [-Wstring-plus-int]
https://bugs.webkit.org/show_bug.cgi?id=196343
Summary
Opcode.h(159,27): warning: adding 'unsigned int' to a string does not append ...
Fujii Hironori
Reported
2019-03-28 02:13:02 PDT
Clang 8.0.0 reports the following compilation warning.
> [1229/6361] Building CXX object Source\JavaScriptCore\CMakeFiles\LLIntOffsetsExtractor.dir\llint\LLIntOffsetsExtractor.cpp.obj > In file included from ..\..\Source\JavaScriptCore\llint\LLIntOffsetsExtractor.cpp:31: > In file included from DerivedSources\JavaScriptCore\BytecodeStructs.h:32: > In file included from ..\..\Source\JavaScriptCore\bytecode\BytecodeDumper.h:29: > In file included from ..\..\Source\JavaScriptCore\bytecode/CallLinkInfo.h:31: > In file included from ..\..\Source\JavaScriptCore\jit\PolymorphicCallStubRoutine.h:30: > In file included from ..\..\Source\JavaScriptCore\bytecode\CallEdge.h:28: > In file included from ..\..\Source\JavaScriptCore\bytecode/CallVariant.h:28: > In file included from ..\..\Source\JavaScriptCore\runtime\ExecutableBaseInlines.h:28: > In file included from ..\..\Source\JavaScriptCore\runtime/ExecutableBase.h:34: > In file included from ..\..\Source\JavaScriptCore\bytecode\UnlinkedCodeBlock.h:34: > In file included from ..\..\Source\JavaScriptCore\bytecode/InstructionStream.h:29: > In file included from ..\..\Source\JavaScriptCore\bytecode/Instruction.h:28: > ..\..\Source\JavaScriptCore\bytecode/Opcode.h(159,27): warning: adding 'unsigned int' to a string does not append to the string [-Wstring-plus-int] > return PADDING_STRING + PADDING_STRING_LENGTH - pad; > ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ > ..\..\Source\JavaScriptCore\bytecode/Opcode.h(159,27): note: use array indexing to silence this warning > return PADDING_STRING + PADDING_STRING_LENGTH - pad; > ^ > & [ ] > 1 warning generated.
> clang version 8.0.0 (tags/RELEASE_800/final) > Target: x86_64-pc-windows-msvc > Thread model: posix
Attachments
Patch
(2.75 KB, patch)
2019-03-28 02:38 PDT
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Patch
(2.81 KB, patch)
2019-03-28 02:53 PDT
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Patch
(3.64 KB, patch)
2019-03-28 03:19 PDT
,
Fujii Hironori
saam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2019-03-28 02:38:40 PDT
Created
attachment 366158
[details]
Patch
Fujii Hironori
Comment 2
2019-03-28 02:41:16 PDT
I have questions. * How to test this code? * Is there a port enabling OPCODE_STATS?
Fujii Hironori
Comment 3
2019-03-28 02:53:12 PDT
Created
attachment 366159
[details]
Patch
Fujii Hironori
Comment 4
2019-03-28 03:04:30 PDT
If define ENABLE_OPCODE_STATS 1, can't compile due to other issues.
> In file included from DerivedSources\JavaScriptCore\unified-sources\UnifiedSource-f0a787a9-8.cpp:6: > ..\..\Source\JavaScriptCore\bytecode/Opcode.cpp(97,38): error: no template named 'pair'; did you mean 'std::pair'? > std::pair<int, int> leftPair = *(pair<int, int>*) left; > ^~~~ > std::pair > C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\utility(93,9): note: 'std::pair' declared here > struct pair > ^ > In file included from DerivedSources\JavaScriptCore\unified-sources\UnifiedSource-f0a787a9-8.cpp:6: > ..\..\Source\JavaScriptCore\bytecode/Opcode.cpp(99,39): error: no template named 'pair'; did you mean 'std::pair'? > std::pair<int, int> rightPair = *(pair<int, int>*) right; > ^~~~ > std::pair > C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\utility(93,9): note: 'std::pair' declared here > struct pair > ^ > 2 errors generated.
Fujii Hironori
Comment 5
2019-03-28 03:17:07 PDT
Comment on
attachment 366159
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=366159&action=review
> Source/JavaScriptCore/bytecode/Opcode.cpp:63 > + return &padding[stringLength - width];
out-of-bound access occurs if the opcode name is longer than width.
Fujii Hironori
Comment 6
2019-03-28 03:19:45 PDT
Created
attachment 366162
[details]
Patch
Fujii Hironori
Comment 7
2019-03-28 03:25:57 PDT
(In reply to Fujii Hironori from
comment #2
)
> I have questions. > * How to test this code?
Define ENABLE_OPCODE_STATS and execute jsc.exe and type "quit()".
> * Is there a port enabling OPCODE_STATS?
No.
Fujii Hironori
Comment 8
2019-03-28 18:29:54 PDT
Committed
r243633
: <
https://trac.webkit.org/changeset/243633
>
Radar WebKit Bug Importer
Comment 9
2019-03-28 18:30:56 PDT
<
rdar://problem/49405319
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug