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 f65fa39f authored by John Zhang's avatar John Zhang
Browse files

fix: add type casting code before function calls to correct types.

parent 755f7835
......@@ -602,12 +602,24 @@ class LL2MuMapper:
# ----------------
# call ops
def _prepare_call_args(self, args, Sig):
ops = []
call_args = []
for (a, ARG) in zip(args, Sig.ARGS):
if a.concretetype == ARG:
call_args.append(a)
else:
a_cast = varof(ARG)
ops.extend(self.map_op_force_cast(SpaceOperation('force_cast', [a], a_cast)))
call_args.append(a_cast)
return call_args, ops
def map_op_direct_call(self, llop):
fr = llop.args[0].value
if isinstance(fr, mutype._muufuncptr): # external function
return [self.gen_mu_ccall(llop.args[0], llop.args[1:], llop.result)]
else:
return [self.gen_mu_call(llop.args[0], llop.args[1:], llop.result)]
args, ops = self._prepare_call_args(llop.args[1:], mutype.mutypeOf(fr).Sig)
mtd = self.gen_mu_ccall if isinstance(fr, mutype._muufuncptr) else self.gen_mu_call
ops.append(mtd(llop.args[0], args, llop.result))
return ops
def map_op_indirect_call(self, llop):
last = llop.args[-1]
......@@ -615,7 +627,9 @@ class LL2MuMapper:
args = llop.args[1:-1]
else:
args = llop.args[1:]
return [self.gen_mu_call(llop.args[0], args, llop.result)]
call_args, ops = self._prepare_call_args(args, llop.args[0].concretetype.Sig)
ops.append(self.gen_mu_call(llop.args[0], call_args, llop.result))
return ops
# ----------------
# primitive ops
......
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