Commit bf79bbd4 authored by Tobias Rapp's avatar Tobias Rapp
Browse files

amd64: Fix segfault for functions with variable arguments

(printf now works with floating point)
parent c99e3533
......@@ -198,6 +198,11 @@ amd64_cconv_t *amd64_decide_calling_convention(ir_type *function_type,
}
}
/* vararg calls need additional stack space */
if (get_method_variadicity(function_type) == variadicity_variadic) {
stack_offset += AMD64_REGISTER_SIZE;
}
amd64_cconv_t *cconv = XMALLOCZ(amd64_cconv_t);
cconv->parameters = params;
cconv->param_stack_size = stack_offset;
......
Supports Markdown
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