imgui-go
imgui-go copied to clipboard
Disable assert in imgui
imgui.h Assertion im of line 1752 in IM_ASSERT(Size > 0); It will prevent me from using PushColorWindowBg. Once I disable assertions, there will be no problems and no other problems. I don't understand the meaning of this paragraph
My go version is 1.18
Hello there, and thank you for your patience.
This particular assert ensures that back()
is only called when there is at least one element in the Data
array. If it is empty, the Size
member will most likely be zero, and thus the calculation of 0 - 1
will result in accessing memory that is not meant to be read.
You could compare this to an "array index out of bounds" panic in Go.
You need to trace back why this back()
is called in a case where the corresponding list is empty.