+2009-04-08 Zoltan Varga <vargaz@gmail.com>
+
+ * mini-llvm.c (mono_llvm_emit_method): Pass i1/i2 arguments as i4 since
+ JITted code depends on it.
+
2009-04-08 Raja R Harinath <harinath@hurrynot.org>
* aot-compiler.c: Use new MonoGenericParam accessors.
}
}
+static LLVMTypeRef
+type_to_llvm_arg_type (EmitContext *ctx, MonoType *t)
+{
+ LLVMTypeRef ptype = type_to_llvm_type (ctx, t);
+
+ if (ptype == LLVMInt8Type () || ptype == LLVMInt16Type ()) {
+ /*
+ * LLVM generates code which only sets the lower bits, while JITted
+ * code expects all the bits to be set.
+ */
+ ptype = LLVMInt32Type ();
+ }
+
+ return ptype;
+}
+
static G_GNUC_UNUSED LLVMTypeRef
llvm_type_to_stack_type (LLVMTypeRef type)
{
for (i = 0; i < sig->param_count; ++i) {
if (MONO_TYPE_ISSTRUCT (sig->params [i]))
LLVM_FAILURE (ctx, "vtype param");
- param_types [pindex ++] = type_to_llvm_type (ctx, sig->params [i]);
+ param_types [pindex ++] = type_to_llvm_arg_type (ctx, sig->params [i]);
}
CHECK_FAILURE (ctx);
if (i == 0 && sig->hasthis)
args [pindex] = convert (ctx, args [pindex], IntPtrType ());
else
- args [pindex] = convert (ctx, args [pindex], type_to_llvm_type (ctx, sig->params [i - sig->hasthis]));
+ args [pindex] = convert (ctx, args [pindex], type_to_llvm_arg_type (ctx, sig->params [i - sig->hasthis]));
pindex ++;
l = l->next;