jump bypasses variable initialization

RESOLVED FIXED in mozilla7

Status

()

Core
Security: PSM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: espindola, Assigned: espindola)

Tracking

unspecified
mozilla7
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 535172 [details] [diff] [review]
move the variable definition

nsNSSCertificateDB.cpp now fails to compile with clang because a goto jumps over

CERTValOutParam cvout[1];
Attachment #535172 - Flags: review?(kaie)

Comment 1

6 years ago
Comment on attachment 535172 [details] [diff] [review]
move the variable definition

>diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp
>index dada28d..cb49fed 100644
>--- a/security/manager/ssl/src/nsNSSCertificateDB.cpp
>+++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp
>@@ -562,6 +562,10 @@ nsNSSCertificateDB::ImportEmailCertificate(PRUint8 * data, PRUint32 length,
> 
>   numcerts = certCollection->numcerts;
> 
>+  // Note: This has to be defined before the first "goto loser", otherwise clang
>+  // will error saying: "jump bypasses variable initialization".

Comment not necessary


>+  CERTValOutParam cvout[1];

Please move this further up. Please move it to the section where all variables are declared, after the "int i".


>-  CERTValOutParam cvout[1];
>   cvout[0].type = cert_po_end;

Please move both lines.

Could you please make these changes?
Attachment #535172 - Flags: review?(kaie) → review-
Created attachment 535637 [details] [diff] [review]
updated patch
Attachment #535172 - Attachment is obsolete: true
Attachment #535637 - Flags: review?(kaie)

Comment 3

6 years ago
Comment on attachment 535637 [details] [diff] [review]
updated patch

Review of attachment 535637 [details] [diff] [review]:
-----------------------------------------------------------------

r=kaie

Thanks
Attachment #535637 - Flags: review?(kaie) → review+
Keywords: checkin-needed

Updated

6 years ago
Assignee: nobody → respindola
http://hg.mozilla.org/mozilla-central/rev/7fb970049952
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
You need to log in before you can comment on or make changes to this bug.