fix JSCore segmentation fault on 64-bit big endian systems
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sat, 8 Jul 2023 07:25:33 +0000 (08:25 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Sat, 8 Jul 2023 07:25:33 +0000 (08:25 +0100)
commit446247426f3ebb31d2ffc127bd456a9b11e5243f
tree02a604a5474025314efb5b3e247b863ce7873b2f
parent82dc87c0a7ca9ae7fd4fd45b019dd2aaa1c24993
fix JSCore segmentation fault on 64-bit big endian systems

Origin: backport, https://github.com/webkit/webkit/commit/3fdde71c7d95d758
Reviewed-by: Frank Heimes <frank.heimes@canonical.com>
Last-Update: 2021-11-24

In CodeBlock.cpp the code preparing the operands of op_get_from_scope writes
the property offset as pointer size (hence 64 bit) value:

2141: instructions[i + 6].u.pointer = reinterpret_cast<void*>(op.operand);

while the same slot is accessed later by the jitted code as 32 bit integer:

macro getProperty(slow)
   loadisFromInstruction(6, t1)

This fails on big endian targets since the integer access takes the higher
part of the 64 bit value.

Gbp-Pq: Name jscore_big_endian.diff
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm