On Aug 10, 2010, at 1:00 AM, "attardi at di dot unipi dot it" > wrote:
Code produced using -O2 handles dereferencing incorrectly.
Here is a program that shows the bug:
#include
#include
class Derived : public std::vector
{
public:
Derived() {}
};
void* foo(void* arg) {
void* basept
Code produced using -O2 handles dereferencing incorrectly.
Here is a program that shows the bug:
#include
#include
class Derived : public std::vector
{
public:
Derived() {}
};
void* foo(void* arg) {
void* baseptr = 0;
*(std::vector **)&baseptr = (Derived *)arg;
return baseptr