• R/O
  • HTTP
  • SSH
  • HTTPS

thirdparty-breakpad: Commit

Breakpad, a crash reporter, from Google.

Original home: https://chromium.googlesource.com/breakpad/breakpad/


Commit MetaInfo

Révision73d2773f9f455944e2cec1c0ad3ea9f5e6705361 (tree)
l'heure2017-10-27 07:25:57
AuteurBruce Dawson <brucedawson@chro...>
CommiterMark Mentovai

Message de Log

Avoid skipping an initializer with a goto

C++ doesn't allow skipping initialization with a goto. This means that
this code is illegal:

void func(bool b) {
if(b) goto END;
int value = 0; //error C2362 with /permissive-
//... value used here
END:
return;
}

Adding an extra scope makes the code legal. This problem is only
detected with /permissive- but now that compiling with this
switch is practical we might as well stay /permissive- clean:
https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/

Note that compiling /permissive- clean only works with the 10.0.16299.0
SDK which currently has other issues...

Bug: 773476
Change-Id: I54e64aaef46d70a817cf7da272f76d9ae5f6a6f7
Reviewed-on: https://chromium-review.googlesource.com/740287
Reviewed-by: Mark Mentovai <mark@chromium.org>

Change Summary

Modification

--- a/src/common/windows/pdb_source_line_writer.cc
+++ b/src/common/windows/pdb_source_line_writer.cc
@@ -1166,12 +1166,15 @@ int PDBSourceLineWriter::GetFunctionStackParamSize(IDiaSymbol *function) {
11661166 goto next_child;
11671167 }
11681168
1169- int child_end = child_register_offset + static_cast<ULONG>(child_length);
1170- if (child_register_offset < lowest_base) {
1171- lowest_base = child_register_offset;
1172- }
1173- if (child_end > highest_end) {
1174- highest_end = child_end;
1169+ // Extra scope to avoid goto jumping over variable initialization
1170+ {
1171+ int child_end = child_register_offset + static_cast<ULONG>(child_length);
1172+ if (child_register_offset < lowest_base) {
1173+ lowest_base = child_register_offset;
1174+ }
1175+ if (child_end > highest_end) {
1176+ highest_end = child_end;
1177+ }
11751178 }
11761179
11771180 next_child:
Afficher sur ancien navigateur de dépôt.