Commit b86cd4b5 authored by John Zhang's avatar John Zhang

fix previous illegitimate fix

parent dcf0b4c9
Pipeline #874 failed with stage
in 0 seconds
......@@ -893,11 +893,13 @@ class LL2MuMapper:
# sz = fix + itm * n
v = varof(mutype.MU_INT64)
ops.extend(
self.map_op(SpaceOperation('int_mul', [Constant(mutype.mu_int64(itm), mutype.MU_INT64), n_c], v)))
ops.extend(self.map_op(SpaceOperation(
'int_mul', [Constant(mutype.mu_int64(itm), mutype.MU_INT64), n_c], v)))
sz = varof(mutype.MU_INT64, 'sz')
ops.extend(self.map_op(SpaceOperation('int_add', [Constant(mutype.mu_int64(fix), mutype.MU_INT64), v], sz)))
ops.extend(self.map_op(SpaceOperation('raw_malloc', [sz], llop.result)))
ops.extend(self.map_op(SpaceOperation(
'int_add', [Constant(mutype.mu_int64(fix), mutype.MU_INT64), v], sz)))
ops.extend(self.map_op(SpaceOperation(
'raw_malloc', [sz], llop.result)))
if 'length' in MuT._names:
ops.extend(self.map_op(SpaceOperation(
......@@ -1240,12 +1242,11 @@ class LL2MuMapper:
if mufnp._name in ('memcpy', 'memmove'):
args = [args[1], args[0], args[2]]
if llop.opname == 'raw_malloc':
if Sig.RESULTS[0] != llop.result.concretetype:
malloc_res = varof(Sig.RESULTS[0])
muops.append(self.gen_mu_ccall(callee, args, malloc_res))
llop_fc = SpaceOperation('force_cast', [malloc_res], llop.result)
muops += self.map_op(llop_fc)
if llop.opname == 'raw_malloc' and Sig.RESULTS[0] != llop.result.concretetype:
malloc_res = varof(Sig.RESULTS[0])
muops.append(self.gen_mu_ccall(callee, args, malloc_res))
llop_fc = SpaceOperation('force_cast', [malloc_res], llop.result)
muops += self.map_op(llop_fc)
else:
muops.append(self.gen_mu_ccall(callee, args, llop.result))
return muops
......
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