Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua: pop the metatable we created off the stack #796

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

brakhane
Copy link
Collaborator

@brakhane brakhane commented Feb 1, 2024

Lua 5.4 crashes without this, given enough calls to Register()

And I can also get 5.3 to crash if I loop 10 times around

Luna<Scene_BindLua>::Register(L);
Luna<NameComponent_BindLua>::Register(L);
Luna<LayerComponent_BindLua>::Register(L);
Luna<TransformComponent_BindLua>::Register(L);
Luna<CameraComponent_BindLua>::Register(L);
Luna<AnimationComponent_BindLua>::Register(L);
Luna<MaterialComponent_BindLua>::Register(L);
Luna<MeshComponent_BindLua>::Register(L);
Luna<EmitterComponent_BindLua>::Register(L);
Luna<HairParticleSystem_BindLua>::Register(L);
Luna<LightComponent_BindLua>::Register(L);
Luna<ObjectComponent_BindLua>::Register(L);
Luna<InverseKinematicsComponent_BindLua>::Register(L);
Luna<SpringComponent_BindLua>::Register(L);
Luna<ScriptComponent_BindLua>::Register(L);
Luna<RigidBodyPhysicsComponent_BindLua>::Register(L);
Luna<SoftBodyPhysicsComponent_BindLua>::Register(L);
Luna<ForceFieldComponent_BindLua>::Register(L);
Luna<Weather_OceanParams_BindLua>::Register(L);
Luna<Weather_AtmosphereParams_BindLua>::Register(L);
Luna<Weather_VolumetricCloudParams_BindLua>::Register(L);
Luna<WeatherComponent_BindLua>::Register(L);
Luna<SoundComponent_BindLua>::Register(L);
Luna<ColliderComponent_BindLua>::Register(L);
Luna<ExpressionComponent_BindLua>::Register(L);
Luna<HumanoidComponent_BindLua>::Register(L);
Luna<DecalComponent_BindLua>::Register(L);
without this patch applies. With this patch, it doesn't crash

Copy link
Owner

@turanszkij turanszkij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@turanszkij turanszkij merged commit 0fa82f7 into turanszkij:master Feb 1, 2024
3 checks passed
@brakhane brakhane deleted the lua-fix branch February 1, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants