Checking tag and seal on rVal2 and checking type on rVal1 in a way that does not use undefined behavior.
This commit is contained in:
@@ -424,7 +424,7 @@ function ExecResult basicExec(DecodedInst dInst, CapPipe rVal1, CapPipe rVal2, C
|
||||
capException = Invalid;
|
||||
boundsCheck = Invalid;
|
||||
end
|
||||
if (dInst.capChecks.ccopytype_bypass && isValidCap(rVal1) && getKind(rVal1) == UNSEALED && !validAsType(rVal1, zeroExtend(getKind(rVal1).SEALED_WITH_TYPE))) begin
|
||||
if (dInst.capChecks.ccopytype_bypass && isValidCap(rVal2) && getKind(rVal2) == UNSEALED && (getKind(rVal1) matches tagged SEALED_WITH_TYPE .t ? !validAsType(rVal2, zeroExtend(t)) : True)) begin
|
||||
capException = Invalid;
|
||||
boundsCheck = Invalid;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user