Issue 58: overflow at srandom(osx only)
http://code.google.com/p/v8/issues/detail?id=58

New issue report by [EMAIL PROTECTED]:
Report and patch by Tokuhiro Matsuno:

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();
  }




Issue attributes:
        Status: Accepted
        Owner: [EMAIL PROTECTED]
        Labels: Type-Bug Priority-High

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to