From 0b93ab3317ac2a8d8f144eac85449768409a41e8 Mon Sep 17 00:00:00 2001 From: "graehl@gmail.com" Date: Mon, 16 Aug 2010 09:17:46 +0000 Subject: fixed vector iter invalid. from push_back git-svn-id: https://ws10smt.googlecode.com/svn/trunk@561 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/cfg.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/decoder/cfg.cc b/decoder/cfg.cc index 0fbb6a03..b0d4eab6 100755 --- a/decoder/cfg.cc +++ b/decoder/cfg.cc @@ -366,15 +366,16 @@ RHS null_for::null(1,std::numeric_limits::min()); void CFG::BinarizeSplit(CFGBinarize const& b) { add_virtual_rules v(*this,b.bin_name_nts); CFG_FOR_RULES(i,v.split_rhs(rules[i].rhs,false,false)); + Rules &newr=v.new_rules; #undef CFG_FOR_VIRT #define CFG_FOR_VIRT(r,expr) \ - for (Rules::iterator ri=v.new_rules.begin(),e=v.new_rules.end();ri!=e;++ri) { \ - Rule &r=*ri;expr; } + for (int i=0,e=newr.size();i