mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 00:20:40 +03:00
Fix bad signature in call to _d_arraysetctor / _d_arraysetassign.
The count parameter is int, not size_t.
This commit is contained in:
parent
09ee1ed027
commit
ae4344714c
2 changed files with 8 additions and 3 deletions
|
@ -234,8 +234,13 @@ void DtoArraySetAssign(Loc& loc, DValue *array, DValue *value, int op)
|
|||
assert(array && value);
|
||||
assert(op != TOKblit);
|
||||
|
||||
LLValue *ptr = DtoArrayPtr(array);
|
||||
LLValue *len = DtoArrayLen(array);
|
||||
LLValue* ptr = DtoArrayPtr(array);
|
||||
LLValue* len = DtoArrayLen(array);
|
||||
// The count parameter is of type int but len is of type size_t.
|
||||
// If size_t is not int then truncated the value.
|
||||
LLType* intType = LLType::getInt32Ty(gIR->context());
|
||||
if (len->getType() != intType)
|
||||
len = gIR->ir->CreateTrunc(len, intType);
|
||||
|
||||
LLFunction* fn = LLVM_D_GetRuntimeFunction(loc, gIR->module, op == TOKconstruct ? "_d_arraysetctor" : "_d_arraysetassign");
|
||||
LLValue* args[] = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue