From 49dccdfa00a46d76a84bc1e5adeee4c66df531b5 Mon Sep 17 00:00:00 2001 From: Clemens Vonrhein Date: Fri, 22 May 2026 12:21:21 +0200 Subject: [PATCH] fix(grid): restore spacegroup member initialization Restores the initialization of GridMeta::spacegroup = nullptr that was inadvertently removed in PR #418. This fixes undefined behavior when the space group pointer is accessed before being explicitly set. Part of comprehensive fix for initialization removals introduced in Doxygen documentation PR series (#413-#422). --- include/gemmi/grid.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gemmi/grid.hpp b/include/gemmi/grid.hpp index c9bd76558..eb3d94472 100644 --- a/include/gemmi/grid.hpp +++ b/include/gemmi/grid.hpp @@ -244,7 +244,7 @@ inline double cubic_interpolation_der(double u, double a, double b, double c, do /// Grid indices u, v, w are in the range [0, nu), [0, nv), [0, nw) for valid grids. struct GridMeta { UnitCell unit_cell; ///< Unit cell of the crystal - const SpaceGroup* spacegroup; ///< Space group (may be nullptr for P1) + const SpaceGroup* spacegroup = nullptr; ///< Space group (may be nullptr for P1) int nu = 0, nv = 0, nw = 0; ///< Grid dimensions AxisOrder axis_order = AxisOrder::Unknown; ///< Grid axis correspondence to a, b, c