mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Fix u256 to APInt conversion
This commit is contained in:
parent
65af01cda8
commit
4ff7ba015d
1 changed files with 1 additions and 4 deletions
|
|
@ -43,10 +43,7 @@ llvm::ConstantInt* Constant::get(uint64_t _n)
|
|||
|
||||
llvm::ConstantInt* Constant::get(u256 _n)
|
||||
{
|
||||
auto& backend = _n.backend();
|
||||
auto words = reinterpret_cast<uint64_t*>(backend.limbs());
|
||||
auto nWords = backend.limb_bits == 64 ? backend.size() : (backend.size() + 1) / 2;
|
||||
llvm::APInt n(256, nWords, words);
|
||||
llvm::APInt n(256, _n.str(0, std::ios_base::hex), 16);
|
||||
assert(n.toString(10, false) == _n.str());
|
||||
return static_cast<llvm::ConstantInt*>(llvm::ConstantInt::get(Type::i256, n));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue