eosio.contracts icon indicating copy to clipboard operation
eosio.contracts copied to clipboard

stod causes access violation error

Open Arkyris opened this issue 2 years ago • 0 comments

Sorry if this is the wrong place for this.

I'm parsing out a memo and after a lot of fiddling the only culprit I can find is stod.

 `string_view cpuSV = parsedMemo[0];
  int64_t cpuAmount = stoi(parsedMemo[1]) * 100000000;
  check(0==1, parsedMemo[2]);
  double days = stod(parsedMemo[2]);

  check(0==1, "Here");`

outputs the correct string held in parsedMemo[2]

 `string_view cpuSV = parsedMemo[0];
  int64_t cpuAmount = stoi(parsedMemo[1]) * 100000000;
  double days = stod(parsedMemo[2]);

  check(0==1, "Here");`

outputs access violation

 `string_view cpuSV = parsedMemo[0];
  int64_t cpuAmount = stoi(parsedMemo[1]) * 100000000;
  int64_t days = stoi(parsedMemo[2]);

  check(0==1, "Here");`

outputs Here

Arkyris avatar Mar 10 '22 15:03 Arkyris