NO

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

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1882
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 »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2169
    • 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: 1882
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.

Offline John Z

  • Member
  • *
  • Posts: 385
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: 2169
    • 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