<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - UB when left shifting at llvm/lib/Fuzzer/FuzzerDriver.cpp:443"
href="https://llvm.org/bugs/show_bug.cgi?id=31456">31456</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>UB when left shifting at llvm/lib/Fuzzer/FuzzerDriver.cpp:443
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ttaubert@mozilla.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>../../fuzz/libFuzzer/FuzzerDriver.cpp:443:73: runtime error: left shift of
1482473285005367997 by 10 places cannot be represented in type 'rep' (aka
'long')
#0 0x514ea6 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char
const*, unsigned long))
/home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerDriver.cpp:443:73
#1 0x508724 in main /home/worker/nss/out/Debug/../../fuzz/nssfuzz.cc:151:10
#2 0x7f91efbfd82f in __libc_start_main
/build/glibc-t3gR2i/glibc-2.23/csu/../csu/libc-start.c:291
#3 0x41ee98 in _start (/home/worker/dist/Debug/bin/nssfuzz+0x41ee98)
SUMMARY: AddressSanitizer: undefined-behavior
../../fuzz/libFuzzer/FuzzerDriver.cpp:443:73 in
The code is the following:
<span class="quote">> // Initialize Seed.
> if (Seed == 0)
> Seed = (std::chrono::system_clock::now().time_since_epoch().count() << 10) +
> getpid();</span >
I think this wants a static_cast<unsigned>(...) before shifting.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>