Files
rippled/docker/test_files/cpp_sources/ubsan.cpp
2026-06-01 16:47:01 +00:00

14 lines
303 B
C++

#include <iostream>
#include <limits>
int
main()
{
int maxInt = std::numeric_limits<int>::max();
int volatile one = 1;
std::cout << "Current max: " << maxInt << std::endl;
int overflowed = maxInt + one;
std::cout << "Overflowed result: " << overflowed << std::endl;
return 0;
}