File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/engine/internal/llvm/instructions Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ LLVMInstruction *String::buildStringChar(LLVMInstruction *ins)
8585 const auto &arg1 = ins->args [0 ];
8686 const auto &arg2 = ins->args [1 ];
8787 llvm::Value *str = m_utils.castValue (arg1.second , arg1.first );
88- llvm::Value *index = m_builder. CreateFPToSI ( m_utils.castValue (arg2.second , arg2.first ), m_builder. getInt64Ty () );
88+ llvm::Value *index = m_utils.castValue (arg2.second , arg2.first , LLVMBuildUtils::NumberType::Int );
8989 llvm::PointerType *charPointerType = m_builder.getInt16Ty ()->getPointerTo ();
9090 llvm::StructType *stringPtrType = m_utils.compilerCtx ()->stringPtrType ();
9191
@@ -131,6 +131,8 @@ LLVMInstruction *String::buildStringLength(LLVMInstruction *ins)
131131 llvm::Value *sizeField = m_builder.CreateStructGEP (stringPtrType, str, 1 );
132132 llvm::Value *size = m_builder.CreateLoad (m_builder.getInt64Ty (), sizeField);
133133 ins->functionReturnReg ->value = m_builder.CreateSIToFP (size, m_builder.getDoubleTy ());
134+ ins->functionReturnReg ->intValue = size;
135+ ins->functionReturnReg ->isInt = m_builder.getInt1 (true );
134136
135137 return ins->next ;
136138}
You can’t perform that action at this time.
0 commit comments