-
Notifications
You must be signed in to change notification settings - Fork 122
ConstraintGear2D: AccessViolationException when trying to add it to the node #50
Comments
Please provide a stack trace |
@migueldeicaza looks like it caused by overflow of StringHash.Code field (it should be uint instead of int) because now for that specific class (ConstraintGear2D) the StringHash LookupStringHash returns hash with a negative big code. |
I've just checked - ConstraintGear2D::GetTypeStatic() returns 4159594590 (almost twice larger than Int32.MaxValue). |
I am confused, can you produce a small reproduction test case? |
@migueldeicaza
valueMono is -135372706
valueCpp is 4159594590 but they should be the same. that's because of int type of Code field in StringHash instead of uint (used in C++ version). |
They are internally the same value. Both -135372706 and 4159594590 are the same bit pattern (0xf7ee605e). So the question is: how do I reproduce the crash, not how do I reproduce the two values rendering differently. |
Oh, you are right, they are the same. let me collect the stacktrace. |
I've filed an issue - #54 |
32_Urho2DConstraints C# (Line 344)
someNode.CreateComponent()
or
someNode.AddComponent(new ConstraintGear2D(Context));
throw AccessViolationException
The text was updated successfully, but these errors were encountered: