WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit f24cbcad authored by John Zhang's avatar John Zhang
Browse files

fix: updating test to allow force_cast ref->uptr through pinning

parent db63b8b0
......@@ -1212,6 +1212,7 @@ class LL2MuMapper:
return [self.gen_mu_convop(optr, DST, var, llop.result)]
assert isinstance(SRC, mutype.MuRef) and isinstance(DST, mutype.MuUPtr)
# allowing ref -> uptr through pinning
ops = self.map_op_cast_ptr_to_adr(SpaceOperation('cast_ptr_to_adr', [var], llop.result))
return ops
......@@ -508,8 +508,10 @@ def test_force_cast():
muops = ll2mu.map_op(SpaceOperation('force_cast', [varof(mutype.MU_INT64)], varof(mutype.MuUPtr(Stt))))
assert [op.opname for op in muops] == ['mu_convop']
with pytest.raises(AssertionError):
ll2mu.map_op(SpaceOperation('force_cast', [varof(mutype.MuRef(Stt))], varof(mutype.MuUPtr(mutype.MU_INT64))))
# allowing ref -> uptr through pinning
muops = ll2mu.map_op(SpaceOperation('force_cast', [varof(mutype.MuRef(Stt))], varof(mutype.MuUPtr(mutype.MU_INT64))))
assert [op.opname for op in muops] == ['mu_comminst', 'mu_convop']
muops = ll2mu.map_op(SpaceOperation('force_cast', [varof(mutype.MuRef(Stt))], varof(mutype.MuRef(mutype.MU_INT64))))
assert [op.opname for op in muops] == ['mu_convop']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment