Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Nasty bug caused by incorrect VA tooltip

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
BruteForce Posted - Oct 29 2008 : 08:39:49 AM
First let's start with the definitions:

WinBase.h ==> #define FillMemory RtlFillMemory
WinNT.h ==> #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))


Note that RtlFillMemory and memset have their two numeric parameters in reverse order.

So in my source file I started typing: "FillMemory("
The VA tooltip appears showing the definition of RtlFillMemory but note that the highlighted parameter is that of memset NOT of RtlFillMemory.
Of course that's a bit hard to spot when all you care about is to write some code, so I didn't notice at that time.
As soon as I typed my pointer variable and entered the comma then the "Fill" parameter of memset got highlighted, so I naturally entered the fill value... Then another comma and the "Length" parameter got highlighted... so I entered the length. Everything compiled normally and I started to debug the code.

As you can realize the catastrophic results widely depend on the values entered and where the target memory is... In my case the buffer was on the stack, so I got some nasty debug warnings when I returned from the function which made me start looking as to what could be going wrong in such a simple function.

Warm Regards,
Dimitris Staikos
2   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jan 27 2009 : 9:06:40 PM
Bolding of macro parameters is case=22603.

case=22603 is fixed in build 1715
feline Posted - Oct 29 2008 : 2:25:38 PM
*ah* yes, a very nasty problem:





I am wondering how to solve it. We have the opposite problem when the function return type contains round brackets, e.g.

#define FIREAPI_DLL_SPEC __declspec(dllimport)
#define FIREAPI(type) FIREAPI_DLL_SPEC type

FIREAPI(long) ReturnTypeInBrackets(int nParam1, int nParam2) { return 0; }


which has been recently fixed.

I wonder if adding a special case for macro tooltips would work correctly.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000