When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.
Quote from: mmkider on September 28, 2009, 05:25:29 amI Found a crash, See picture.At last, I need keyin '\n' but I keyin '\'. it will crash.I can't reproduce the crash when entering only one statements, can you give a simple testing code?
I Found a crash, See picture.At last, I need keyin '\n' but I keyin '\'. it will crash.
static wxRegEx rePrint(_T("^(@_@)(.*)"));void Test_CodeCompletion(){ static wxString buffer; wxArrayString lines = GetArrayFromString(buffer, _T('\n')); bool bMatch=false; for (unsigned int i = 0; i < lines.GetCount(); ++i) { if (rePrint.Matches(lines[i])) { lines[i]=_T(""); bMatch=true; } } if(bMatch) { buffer.clear(); for (unsigned int i = 0; i < lines.GetCount(); ++i) { if(lines[i]!=_T("")) { buffer+=lines[i]+_T("\n"); // this line will be crash. } } } return; // come back later}
buffer+=lines[i]+_T("\");
I follow you steps, but still can't reproduce this crash.By the way, if you enter these statement:Codebuffer+=lines[i]+_T("\");You will notice that the open brace and the close brace have the different colors. I guess this is caused by Scintilla gramma highlight.
I can more or less confirm this crash on linux.It does not crash, but it hangs and eats 100 % of one of my CPU's.Latest svn-source.I will look into it.
This bug is fixed by this patch
#include <iostream>using namespace std;struct qq{ int x; int y;};struct qq tt;struct qq& xx = tt;xx.int main(){ cout << "Hello world!" << endl; return 0;}
I get 100 % of one of my CPU's too, and my codeblocks can not respond to any key.
Quote from: jens on September 28, 2009, 09:16:15 amI can more or less confirm this crash on linux.It does not crash, but it hangs and eats 100 % of one of my CPU's.Latest svn-source.I will look into it.Cool. I get 100 % of one of my CPU's too, and my codeblocks can not respond to any key.
QuoteI get 100 % of one of my CPU's too, and my codeblocks can not respond to any key.I have this issue too.The programe hang,but 50% of CPU used.EDIT:It seems that (x) tip cause this.
QuoteThis bug is fixed by this patchdoes it work for codes like these?Code#include <iostream>using namespace std;struct qq{ int x; int y;};struct qq tt;struct qq& xx = tt;xx.int main(){ cout << "Hello world!" << endl; return 0;}
struct qq * xxstruct qq & xx
Index: parserthread.cpp===================================================================--- parserthread.cpp (revision 5824)+++ parserthread.cpp (working copy)@@ -1350,8 +1350,13 @@ HandleFunction(current); break; }- else if (next.GetChar(0) != '*')+ else if (next.GetChar(0) == '*' || next.GetChar(0) == '&' ) {+ m_Str<<current;+ break;+ }+ else+ { // might be instantiation, see the following /* struct HiddenStruct {@@ -1391,8 +1396,7 @@ } } }- else- m_Tokenizer.GetToken();+ } else break;
EDIT:And the issue in this thread seems not solved yet.http://forums.codeblocks.org/index.php/topic,10966.msg74954.html#msg74954
while ().
wxString NativeParser::GetNextCCToken(const wxString& line, unsigned int& startAt, bool& is_function){ wxString res; int nest = 0; if ((startAt < line.Length()) && (line.GetChar(startAt) == '(')) { while (startAt < line.Length() && (line.GetChar(startAt) == '*' || line.GetChar(startAt) == '&' || line.GetChar(startAt) == '(')) { if (line.GetChar(startAt) == '(') ++nest; ++startAt; } } //Manager::Get()->GetLogManager()->DebugLog(F(_T("at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str())); while ((startAt < line.Length()) && (wxIsalnum(line.GetChar(startAt)) || line.GetChar(startAt) == '_')) { res << line.GetChar(startAt); ++startAt; } while ((nest > 0) && (startAt < line.Length())) { if (line.GetChar(startAt) == ')') --nest; ++startAt; } //Manager::Get()->GetLogManager()->DebugLog(F(_T("Done nest: at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str())); while (startAt < line.Length()-1&& (line.GetChar(startAt) == ' ' || line.GetChar(startAt) == '\t')) ++startAt; if ((startAt < line.Length()) && (line.GetChar(startAt) == '(' || line.GetChar(startAt) == '[')) { is_function = line.GetChar(startAt) == '('; ++nest; while (startAt < line.Length()-1 && nest != 0) { ++startAt; #if wxCHECK_VERSION(2, 9, 0) switch (line.GetChar(startAt).GetValue()) #else switch (line.GetChar(startAt)) #endif { case ']': case ')': --nest; ++startAt;break; case '[': case '(': ++nest; ++startAt;break; } while (startAt < line.Length()-1&& (line.GetChar(startAt) == ' ' || line.GetChar(startAt) == '\t')) ++startAt; if (startAt < line.Length()-1 && (line.GetChar(startAt) == '(' || line.GetChar(startAt) == '[')) ++nest; } //++startAt; } //Manager::Get()->GetLogManager()->DebugLog("Return at %d (%c): res=%s", startAt, line.GetChar(startAt), res.c_str()); return res;}
while (startAt < line.Length()-1&& (line.GetChar(startAt) == ' ' || line.GetChar(startAt) == '\t')) ++startAt;
This is the modified version of the "right search", it just solve this problem in my previous reply.
struct _s{ int x; float y;};typedef struct _s t_s;int main(){ struct _s s; struct _s& rs = s; struct _s* ps = &s; t_s ts; t_s& rts = ts; t_s* pts = &ts; s. // works rs. // works ps. // works ps-> // does not work ts. // works rts. // works pts. // works pts-> // does not work return 0;}