1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-10 10:00:57 +09:00

Prevent incorrect constant folding (#98561)

* Prevent incorrect constant folding of binary operations involving handle and integer

* Fix the conditions for null nodes

* Fix the last commit for non-GT/GE/LT/LE

* Make JIT format happy

* More conservative approach. Limit only arithmetic operations involving handles in a relocatable code.
This commit is contained in:
Filip Navara 2024-02-19 19:30:48 +01:00 committed by GitHub
parent 5e1caf14fd
commit 1be948c959
Signed by: github
GPG key ID: B5690EEEBB952194

View file

@ -4421,6 +4421,11 @@ bool ValueNumStore::VNEvalCanFoldBinaryFunc(var_types type, VNFunc func, ValueNu
case GT_RSZ:
case GT_ROL:
case GT_ROR:
if (m_pComp->opts.compReloc && (IsVNHandle(arg0VN) || IsVNHandle(arg1VN)))
{
return false;
}
break;
case GT_EQ:
case GT_NE:
@ -4449,6 +4454,11 @@ bool ValueNumStore::VNEvalCanFoldBinaryFunc(var_types type, VNFunc func, ValueNu
case VNF_ADD_UN_OVF:
case VNF_SUB_UN_OVF:
case VNF_MUL_UN_OVF:
if (m_pComp->opts.compReloc && (IsVNHandle(arg0VN) || IsVNHandle(arg1VN)))
{
return false;
}
break;
case VNF_Cast:
case VNF_CastOvf: