in platform-macos.cc
void OS::Setup() {
// Seed the random number generator.
srandom(static_cast<unsigned int>(TimeCurrentMillis()));
}
TimeCurrentMillis() is too big value(e.g. 1220968311809.877935), this
code makes integer overflow problem.
# Current version of v8 makes same random seed in every time on osx =(
follow is a patch:
=== src/platform-macos.cc
==================================================================
--- src/platform-macos.cc (revision 24864)
+++ src/platform-macos.cc (local)
@@ -73,7 +73,7 @@
void OS::Setup() {
// Seed the random number generator.
- srandom(static_cast<unsigned int>(TimeCurrentMillis()));
+ srandomdev();
}
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---