Fix integer overflow in folly/Benchmark.cpp
authorDmitry Panin <panin@fb.com>
Thu, 6 Nov 2014 20:47:43 +0000 (12:47 -0800)
committerPavlo Kushnir <pavlo@fb.com>
Sat, 8 Nov 2014 02:40:13 +0000 (18:40 -0800)
commit53c9c964ce4ce3b7b2965dc75b840a9a3f1d2d1c
tree0ed987ffba22886c87ff3b320eb4be6c71742689
parent3c1306e1e2892142a121d715db0ef8090c69a289
Fix integer overflow in folly/Benchmark.cpp

Summary:
`bm_max_secs` has type int32
So when this value is more than 2, expression
```
FLAGS_bm_max_secs * 1000000000;
```
overflows

Test Plan:
I did put a
```
LOG(INFO) << timeBudgetInNs;
```
and observed correct values (before fix they were overflowed)

Reviewed By: antonl@fb.com

Subscribers: njormrod, folly-diffs@

FB internal diff: D1663247

Signature: t1:1663247:1415261814:c9154ffde183b2a4f5403e534e47e52e8276c61b
folly/Benchmark.cpp