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

Issue 10869063: Add attributions so printf like functions can have their arguments checked. (Closed)

Created:
8 years, 4 months ago by cshapiro
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Add attributions so printf like functions can have their arguments checked. This change also corrects some misuses of format strings and format arguments that discovered by the compiler checks. Committed: https://code.google.com/p/dart/source/detail?r=11912

Patch Set 1 #

Patch Set 2 : rebased #

Patch Set 3 : address review comments #

Patch Set 4 : address review comments #

Patch Set 5 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+379 lines, -321 lines) Patch
M runtime/bin/dbg_connection.cc View 1 2 3 8 chunks +12 lines, -12 lines 0 comments Download
M runtime/bin/eventhandler_linux.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/run_vm_tests.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/array.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/byte_array.cc View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/platform/assert.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/platform/globals.h View 1 2 3 2 chunks +26 lines, -0 lines 0 comments Download
M runtime/platform/json.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/allocation.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/assembler_ia32.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/assembler_x64.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/ast_printer.cc View 1 2 3 4 6 chunks +11 lines, -7 lines 0 comments Download
M runtime/vm/class_finalizer.h View 2 chunks +4 lines, -3 lines 0 comments Download
M runtime/vm/class_table.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 4 12 chunks +15 lines, -15 lines 0 comments Download
M runtime/vm/compiler.cc View 1 2 3 4 8 chunks +13 lines, -13 lines 0 comments Download
M runtime/vm/compiler_stats.cc View 1 2 3 1 chunk +17 lines, -17 lines 0 comments Download
M runtime/vm/dart.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/dart_api_impl.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 12 chunks +12 lines, -12 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/debugger.cc View 1 2 3 4 7 chunks +9 lines, -8 lines 0 comments Download
M runtime/vm/debugger_api_impl.cc View 1 2 3 15 chunks +17 lines, -16 lines 0 comments Download
M runtime/vm/debugger_api_impl_test.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/deopt_instructions.cc View 1 2 3 4 6 chunks +18 lines, -12 lines 0 comments Download
M runtime/vm/disassembler.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/disassembler_ia32.cc View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M runtime/vm/disassembler_x64.cc View 1 2 3 4 16 chunks +22 lines, -22 lines 0 comments Download
M runtime/vm/exceptions.cc View 1 2 3 4 2 chunks +2 lines, -4 lines 0 comments Download
M runtime/vm/flow_graph_allocator.cc View 1 2 3 4 17 chunks +26 lines, -23 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 3 4 5 chunks +6 lines, -6 lines 0 comments Download
M runtime/vm/freelist.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/heap.cc View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M runtime/vm/heap_profiler.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/il_printer.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/il_printer.cc View 1 2 3 4 28 chunks +36 lines, -36 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/locations.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/message_handler.cc View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M runtime/vm/message_handler_test.cc View 1 2 3 1 chunk +6 lines, -2 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 31 chunks +36 lines, -32 lines 0 comments Download
M runtime/vm/os.h View 2 chunks +4 lines, -3 lines 0 comments Download
M runtime/vm/pages.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/parser.h View 1 2 3 4 2 chunks +9 lines, -6 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 10 chunks +11 lines, -11 lines 0 comments Download
M runtime/vm/raw_object.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M runtime/vm/scanner.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/scavenger.cc View 1 2 3 4 3 chunks +5 lines, -3 lines 0 comments Download
M runtime/vm/snapshot_test.cc View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M runtime/vm/stack_frame.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/timer.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M runtime/vm/verifier.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/zone.h View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/zone.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
cshapiro
I believe the size of this change is, in part, a reflection of the overuse ...
8 years, 4 months ago (2012-08-25 04:03:08 UTC) #1
turnidge
Hi Carl, I looked over the changes and didn't see any errors. I'll let Ivan ...
8 years, 4 months ago (2012-08-26 03:34:54 UTC) #2
cshapiro
I have fixed Api::NewError and added PRINTF_ATTRIBUTE to some other functions. Per our off-line conversation, ...
8 years, 3 months ago (2012-08-28 04:31:01 UTC) #3
turnidge
lgtm for turndige. Took a look again. Still fine. Thanks for new additions.
8 years, 3 months ago (2012-08-28 18:18:56 UTC) #4
Ivan Posva
Carl, I like the checking of arguments, but we should discuss alternatives to reduce the ...
8 years, 3 months ago (2012-08-28 23:46:43 UTC) #5
cshapiro
8 years, 3 months ago (2012-08-29 00:26:03 UTC) #6
Hi Ivan,

I think the only way to reduce the amount of format string overhead is to make
more pervasive use of int.  There are a lot of places where we are using
intptr_t when we do not need the additional dynamic range. As an example, I
think the basic block numbers in the compiler could be converted to an int as it
is unlikely that 1) one will ever have more than 2 billion basic blocks and 2)
the number of basic blocks needs to scale with the pointer width of a machine.

Would you like me to hold off on committing pending that discussion?  Just let
me know how you would like this to go.

Carl

Powered by Google App Engine
This is Rietveld 408576698