Bug 1202868, Another Windows bustage fix, variable declarations must go first
--- a/lib/util/secasn1d.c
+++ b/lib/util/secasn1d.c
@@ -1785,16 +1785,17 @@ sec_asn1d_next_substring (sec_asn1d_stat
return;
}
state->pending -= child_consumed;
if (state->pending == 0)
done = PR_TRUE;
} else {
PRBool preallocatedString;
+ sec_asn1d_state *temp_state;
PORT_Assert (state->indefinite);
item = (SECItem *)(child->dest);
/**
* At this point, there's three states at play:
* child: The element that was just parsed
* state: The currently processed element
@@ -1858,17 +1859,17 @@ sec_asn1d_next_substring (sec_asn1d_stat
* constructed encoding, so continue walking the ancestor chain until a
* clear determination can be made.
*
* The variable preallocatedString is used to indicate Case #1/#3,
* indicating an in-place copy has already occurred, and Cases #2, #4,
* and #5 all have the same behaviour of adding a new substring.
*/
preallocatedString = PR_FALSE;
- sec_asn1d_state *temp_state = state;
+ temp_state = state;
while (temp_state && item == temp_state->dest && temp_state->indefinite) {
sec_asn1d_state *parent = sec_asn1d_get_enclosing_construct(temp_state);
if (!parent || parent->underlying_kind != temp_state->underlying_kind) {
/* Case #5 - Either this is a top-level construct or it is part
* of some other element (e.g. a SEQUENCE), in which case, a
* new item should be allocated. */
break;
}