Skip to content

[C++] An implicit buffer-overflow in decimal_benchmark #40276

@ZhangHuiGui

Description

@ZhangHuiGui

Describe the bug, including details regarding any error messages, version, and platform.

An implicit buffer-overflow bug in blow codes:

  for (int x = 0; x < kValueSize; x++) {
    v.emplace_back(100 + x, 100 + x);
  }

  for (auto _ : state) {
    BasicDecimal128 result;
    for (int x = 0; x < 100; x++) { // should be kValueSize
      result += v[x];
    }
    benchmark::DoNotOptimize(result);
  }

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions