commit | 5f2a9a5cddf417866a9d1b9c55ef37b42e477edc | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Tue Mar 08 08:24:38 2022 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Mar 08 17:47:54 2022 +0000 |
tree | aef70271dd5db9e1aded0e294a746a3038517723 | |
parent | abe736a5f3e8a8e7610a09fa3226ce52f8b950a7 [diff] |
pw_tokenizer: Avoid undefined behavior in test generation code It is undefined behavior for std::uniform_int_distribution to use types smaller than short. Switch to int32_t and cast to char instead of using char directly. Change-Id: I037baf54e1100b58338a90340ade43baaf7c6aa6 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/87081 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Reviewed-by: Rob Mohr <mohrr@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/