Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11056
Merged at revision: 11362
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 56 lines (+12/-4)
3 files modified
ChangeLog (+2/-0)
src/compiler/expression/flwor_expr.h (+4/-1)
src/compiler/rewriter/rules/flwor_rules.cpp (+6/-3)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+158110@code.launchpad.net

Commit message

Fixed bug #1154984 (windows build crashes if a vector iterator is reused after it is used to erase an element of the vector)

Description of the change

Fixed bug #1154984 (windows build crashes if a vector iterator is reused after it is used to erase an element of the vector)

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job markos-scratch-2013-04-10T13-55-51.331Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-04-10 10:13:31 +0000
3+++ ChangeLog 2013-04-10 13:45:34 +0000
4@@ -59,6 +59,8 @@
5 * Fixed bug #1076402 (bug in CastIterator when target is QName)
6 * NaN items are considered equal to each other during grouping
7 * Fixed bug #855481 (Too small time types on Windows).
8+ * Fixed bug #1154984 (windows build crashes if a vector iterator is reused
9+ after it is used to erase an element of the vector)
10 * Fixed bug #1132032 (Certain regexes involving ^ should be legal)
11 * Fixed bug #1023168 (Non-single-char-escapes in regex character ranges not
12 caught)
13
14=== modified file 'src/compiler/expression/flwor_expr.h'
15--- src/compiler/expression/flwor_expr.h 2013-02-21 16:34:45 +0000
16+++ src/compiler/expression/flwor_expr.h 2013-04-10 13:45:34 +0000
17@@ -442,7 +442,10 @@
18
19 void set_nongrouping_ars(rebind_list_t& v) { theNonGroupVars = v; }
20
21- void removeNonGroupingVar(rebind_list_t::iterator ite) { theNonGroupVars.erase(ite); }
22+ rebind_list_t::iterator removeNonGroupingVar(rebind_list_t::iterator& ite)
23+ {
24+ return theNonGroupVars.erase(ite);
25+ }
26
27 rebind_list_t::iterator beginGroupVars() { return theGroupVars.begin(); }
28
29
30=== modified file 'src/compiler/rewriter/rules/flwor_rules.cpp'
31--- src/compiler/rewriter/rules/flwor_rules.cpp 2013-04-08 11:38:48 +0000
32+++ src/compiler/rewriter/rules/flwor_rules.cpp 2013-04-10 13:45:34 +0000
33@@ -248,17 +248,20 @@
34 flwor_clause::rebind_list_t::iterator ite = gc->beginNonGroupVars();
35 flwor_clause::rebind_list_t::iterator end = gc->endNonGroupVars();
36
37- for(; ite != end; ++ite)
38+ while(ite != end)
39 {
40 var_expr* var = ite->second;
41 int uses = expr_tools::count_variable_uses(theFlwor, var, 1, NULL);
42
43 if (uses == 0 && !ite->first->isNonDiscardable())
44 {
45- gc->removeNonGroupingVar(ite);
46- --ite;
47+ ite = gc->removeNonGroupingVar(ite);
48 end = gc->endNonGroupVars();
49 }
50+ else
51+ {
52+ ++ite;
53+ }
54 }
55
56 break;

Subscribers

People subscribed via source and target branches