# HG changeset patch # User lindquist # Date 1194546065 -3600 # Node ID 08508eebbb3e13ef5c9e26d19a433409c25e6ed4 # Parent 70d6113eeb8c1612fac72c8ab1f87ef8079b7738 [svn r97] Fixed bug with main(string[] args) on 32 bit systems. 64bit worked. diff -r 70d6113eeb8c -r 08508eebbb3e gen/tollvm.cpp --- a/gen/tollvm.cpp Thu Nov 08 19:13:28 2007 +0100 +++ b/gen/tollvm.cpp Thu Nov 08 19:21:05 2007 +0100 @@ -680,7 +680,9 @@ llvm::Value* arr = new llvm::AllocaInst(at->getContainedType(1)->getContainedType(0), func->arg_begin(), "argstorage", apt); llvm::Value* a = new llvm::AllocaInst(at, "argarray", apt); llvm::Value* ptr = DtoGEPi(a,0,0,"tmp",bb); - llvm::Value* v = new llvm::ZExtInst(args[0], DtoSize_t(), "tmp", bb); + llvm::Value* v = args[0]; + if (v->getType() != DtoSize_t()) + v = new llvm::ZExtInst(v, DtoSize_t(), "tmp", bb); new llvm::StoreInst(v,ptr,bb); ptr = DtoGEPi(a,0,1,"tmp",bb); new llvm::StoreInst(arr,ptr,bb);