I have a method in C++:
HRESULT Foo(const ULONG bar, const ULONG baz, ODP& odp)
ODP is typedef'd to unsigned short
.
When I call this method, I get a VS runtime check error when the calling method ends: "The stack around odp
is corrupted."
When I look at t开发者_如何学Gohe method being called, and hover my mouse, VS pops up this description:
Foo(const unsigned long, const const unsigned long, const unsigned short * const)
Why the inconsistency? Why the two const
s for the middle param? Why isn't the last param ODP&
?
Check to make sure you don't have two different definitions for Foo
or ODP
. If one definition is seen in one context and another somewhere else, you enter the land of undefined behavior.
Possible answer: the VS debugger is getting its info from the machine code, not from the source.
精彩评论