Skip to content

Commit ddf2144

Browse files
committed
Use stoull and uint64_t for for integer parsing
1 parent 40f4306 commit ddf2144

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/grammar/Visitor.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include <limits>
6363
#include <regex>
6464
#include <tuple>
65+
#include <cstdint>
6566

6667
namespace Sand
6768
{
@@ -3322,14 +3323,14 @@ class Visitor
33223323
str.erase(std::remove(str.begin(), str.end(), '_'), str.end());
33233324
str.erase(std::remove(str.begin(), str.end(), '\''), str.end());
33243325

3325-
unsigned long integer = 0;
3326+
uint64_t integer = 0;
33263327
std::string name = "";
33273328
Type *type = nullptr;
33283329
bool is_signed = true;
33293330

33303331
try
33313332
{
3332-
integer = std::stoul(str, nullptr, base);
3333+
integer = std::stoull(str, nullptr, base);
33333334
}
33343335
catch (std::out_of_range &)
33353336
{

0 commit comments

Comments
 (0)