NO

Author Topic: IDE crash on autocomplete when casting a pointer  (Read 3687 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
IDE crash on autocomplete when casting a pointer
« on: November 21, 2021, 12:07:31 PM »
In the following snippet :
Code: [Select]
BOOL CALLBACK IoEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch (msg)
    {
        case WM_INITDIALOG:
             MoveWindow(hwnd, (POINT *)lParam-            //As you press '>' to complete pointer symbol autocomplete crashes the IDE
The statement should have been:
Code: [Select]
             MoveWindow(hwnd, ((POINT *)lParam)->x, ((POINT *)lParam)->y, width, height, TRUE);
« Last Edit: November 21, 2021, 10:09:50 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: IDE crash on autocomplete when casting a pointer
« Reply #1 on: November 21, 2021, 06:53:11 PM »
I will see if I can reproduce this. Right now I can't...
/Pelle

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: IDE crash on autocomplete when casting a pointer
« Reply #2 on: November 21, 2021, 10:14:57 PM »
Thanks Pelle.
I made an error reporting the snippet, now I have fixed it (was missing the 'lParam' in 'MoveWindow(hwnd, (POINT *)lParam-').
I can confirm that it happen almost always when a cast to a pointer is applied.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline John Z

  • Member
  • *
  • Posts: 861
Re: IDE crash on autocomplete when casting a pointer
« Reply #3 on: November 21, 2021, 10:50:33 PM »
It crashes version 10 as well.
to reproduce first paste in the line below

MoveWindow(hwnd, ((POINT *)lParam)->x, ((POINT *)lParam)->y, width, height, TRUE);


1) remove second ) shown in red
2) remove first > shown in red
3) now put first > back and then click in the iDE somewhere else.

IDE will go busy then 'not responding' then total crash a few moments later.
Restart IDE and it will ask if you want to restore the open file from a backup.

John Z

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: IDE crash on autocomplete when casting a pointer
« Reply #4 on: November 22, 2021, 07:25:52 PM »
I made an error reporting the snippet, now I have fixed it (was missing the 'lParam' in 'MoveWindow(hwnd, (POINT *)lParam-').
I can confirm that it happen almost always when a cast to a pointer is applied.
OK, thanks, now I can reproduce...

(...even the Visual Studio JIT-debugger catches on, eventually, after a minute or so... not terribly impressive...)
/Pelle