Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Issue 10037018: Fix OS::VSNPrint to make it behave similar to linux and macos versions. (Closed)

Created:
8 years, 8 months ago by siva
Modified:
8 years, 8 months ago
Reviewers:
hausner, Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix OS::VSNPrint to make it behave similar to linux and macos versions. Mathias found this bug will using it in the JSON parser. Committed: https://code.google.com/p/dart/source/detail?r=6380

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -4 lines) Patch
M runtime/vm/os_win.cc View 1 1 chunk +11 lines, -4 lines 2 comments Download

Messages

Total messages: 5 (0 generated)
siva
8 years, 8 months ago (2012-04-10 20:32:27 UTC) #1
hausner
lgtm w/comment. Thank you for fixing this. https://chromiumcodereview.appspot.com/10037018/diff/1/runtime/vm/os_win.cc File runtime/vm/os_win.cc (right): https://chromiumcodereview.appspot.com/10037018/diff/1/runtime/vm/os_win.cc#newcode177 runtime/vm/os_win.cc:177: if (size ...
8 years, 8 months ago (2012-04-10 20:40:04 UTC) #2
siva
https://chromiumcodereview.appspot.com/10037018/diff/1/runtime/vm/os_win.cc File runtime/vm/os_win.cc (right): https://chromiumcodereview.appspot.com/10037018/diff/1/runtime/vm/os_win.cc#newcode177 runtime/vm/os_win.cc:177: if (size > 0) { On 2012/04/10 20:40:04, hausner ...
8 years, 8 months ago (2012-04-10 20:42:25 UTC) #3
Ivan Posva
https://chromiumcodereview.appspot.com/10037018/diff/2001/runtime/vm/os_win.cc File runtime/vm/os_win.cc (right): https://chromiumcodereview.appspot.com/10037018/diff/2001/runtime/vm/os_win.cc#newcode172 runtime/vm/os_win.cc:172: written = _vscprintf(format, args); You are reusing the args ...
8 years, 8 months ago (2012-04-11 07:34:39 UTC) #4
siva
8 years, 8 months ago (2012-04-11 23:12:51 UTC) #5
https://chromiumcodereview.appspot.com/10037018/diff/2001/runtime/vm/os_win.cc
File runtime/vm/os_win.cc (right):

https://chromiumcodereview.appspot.com/10037018/diff/2001/runtime/vm/os_win.c...
runtime/vm/os_win.cc:172: written = _vscprintf(format, args);
Good point. I have uploaded a CL doing the va_copy stuff.

On 2012/04/11 07:34:39, Ivan Posva wrote:
> You are reusing the args here which is a big NO-NO. It tends to work on ia32,
> but starts breaking for other architectures such as x64.
> 
> You need to use va_copy, which unfortunately is not available in older
versions
> of MSVC.
> 
> Other suggestions: http://stackoverflow.com/questions/2288680/reuse-of-va-list
> or http://stackoverflow.com/questions/1259280/c-varargs-va-copy-issues

Powered by Google App Engine
This is Rietveld 408576698