Return 0 on CToPtr if authority tag unset
This commit is contained in:
@@ -1194,7 +1194,6 @@ function DecodeResult decode(Instruction inst, Bool cap_mode);
|
||||
end
|
||||
f7_cap_CToPtr: begin
|
||||
dInst.capChecks.src1_unsealed = True;
|
||||
dInst.capChecks.src2_tag = True;
|
||||
|
||||
dInst.iType = Cap;
|
||||
regs.dst = Valid(tagged Gpr rd);
|
||||
|
||||
@@ -320,7 +320,7 @@ function Data capInspect(CapPipe a, CapPipe b, CapInspectFunc func);
|
||||
tagged SEALED_WITH_TYPE .t: zeroExtend(t);
|
||||
endcase
|
||||
tagged ToPtr :
|
||||
(isValidCap(a) ? (getAddr(a) - getBase(b)) : 0);
|
||||
(isValidCap(a) && isValidCap(b) ? (getAddr(a) - getBase(b)) : 0);
|
||||
default: ?;
|
||||
endcase);
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user