[PATCH openEuler-21.09 31/46] ima: fix a potential crash owing to the compiler optimisation