Khronos Public Bugzilla
Bug 727 - In cl/cl.hpp, ImageGL::operator= creates a stack overflow
In cl/cl.hpp, ImageGL::operator= creates a stack overflow
Status: RESOLVED FIXED
Product: OpenCL
Classification: Unclassified
Component: Header Files
1.1
All All
: P3 normal
: ---
Assigned To: Aaftab Munshi
OpenCL Working Group
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-08 16:01 PDT by Ulysse Beaugnon
Modified: 2013-06-05 10:25 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulysse Beaugnon 2012-10-08 16:01:53 PDT
In cl/cl.hpp, ImageGL::operator=(const cl_mem& rhs) call itself and creates a stack overflow :

ImageGL& operator = (const cl_mem& rhs)
{
    ImageGL::operator=(rhs);
    return *this;
}

ImageGL::operator=(const ImageGL& rhs) has the same problem. I expect the intended code to be (it is working for me):

ImageGL& operator = (const cl_mem& rhs)
{
    Image::operator=(rhs);
    return *this;
}
Comment 1 Giuseppe Bilotta 2013-06-05 10:25:20 PDT
This seems to be fixed in the latest version of the headers, the definition is now

    ImageGL& operator = (const ImageGL& rhs)
    {
        if (this != &rhs) {
            Image::operator=(rhs);
        }
        return *this;
    }