You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compile with -Wnonnull. 4.0 doesn't look to be affected.
The warning is somewhat hard to trigger due to the UB involved.
Using the following command scons -j16 platform=x11 tools=no target=release_debug CCFLAGS=-Wnonnull after touching scene/3d/baked_lightmap.cpp produces (for me):
scene/3d/baked_lightmap.cpp: In member function 'void BakedLightmap::_find_meshes_and_lights(Node*, Vector<BakedLightmap::MeshesFound>&, Vector<BakedLightmap::LightsFound>&)':
scene/3d/baked_lightmap.cpp:392:73: warning: 'this' pointer is null [-Wnonnull]
392 | all_override = mi->get_material_override();
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from scene/3d/multimesh_instance.h:34,
from scene/3d/baked_lightmap.h:35,
from scene/3d/baked_lightmap.cpp:31:
./scene/3d/visual_instance.h:151:23: note: in a call to non-static member function 'Ref<Material> GeometryInstance::get_material_override() const'151 | Ref<Material> get_material_override() const;
| ^~~~~~~~~~~~~~~~~~~~~
scene/3d/baked_lightmap.cpp:417:87: warning: 'this' pointer is null [-Wnonnull]
417 | mf.cast_shadows = mi->get_cast_shadows_setting() != GeometryInstance::SHADOW_CASTING_SETTING_OFF;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from scene/3d/multimesh_instance.h:34,
from scene/3d/baked_lightmap.h:35,
from scene/3d/baked_lightmap.cpp:31:
./scene/3d/visual_instance.h:130:30: note: in a call to non-static member function 'GeometryInstance::ShadowCastingSetting GeometryInstance::get_cast_shadows_setting() const'130 | ShadowCastingSetting get_cast_shadows_setting() const;
| ^~~~~~~~~~~~~~~~~~~~~~~~
scene/3d/baked_lightmap.cpp:418:89: warning: 'this' pointer is null [-Wnonnull]
418 | mf.generate_lightmap = mi->get_generate_lightmap();
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from scene/3d/multimesh_instance.h:34,
from scene/3d/baked_lightmap.h:35,
from scene/3d/baked_lightmap.cpp:31:
./scene/3d/visual_instance.h:133:14: note: in a call to non-static member function 'bool GeometryInstance::get_generate_lightmap()'133 | boolget_generate_lightmap();
| ^~~~~~~~~~~~~~~~~~~~~
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
Godot version
3.x
System information
Linux
Issue description
mi
has been checked/tested to be null, yet is accessed on the following lines:godot/scene/3d/baked_lightmap.cpp
Line 392 in 40a348b
godot/scene/3d/baked_lightmap.cpp
Line 417 in 40a348b
godot/scene/3d/baked_lightmap.cpp
Line 418 in 40a348b
Should these variables be referencing
gi
?Steps to reproduce
Compile with
-Wnonnull
. 4.0 doesn't look to be affected.The warning is somewhat hard to trigger due to the UB involved.
Using the following command
scons -j16 platform=x11 tools=no target=release_debug CCFLAGS=-Wnonnull
after touchingscene/3d/baked_lightmap.cpp
produces (for me):Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: