### Godot version

Godot Engine v4.1.dev.custom_build (56253c3897b99966ee9e7469fd01e6152f8552ef)

### System information

Fedora 37 KDE, RTX 3080

### Issue description

As soon as one defines an array of sampler2D the editor crashes.

```
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.dev.custom_build (56253c3897b99966ee9e7469fd01e6152f8552ef)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib64/libc.so.6(+0x3cb20) [0x7f4c0d2a5b20] (??:0)
[2] GLES3::SceneMaterialData::bind_uniforms() (/storage/Code/godot/drivers/gles3/storage/material_storage.cpp:3520)
[3] void RasterizerSceneGLES3::_render_list_template<(PassMode)4>(RasterizerSceneGLES3::RenderListParameters*, RenderDataGLES3 const*, unsigned int, unsigned int, bool) (/storage/Code/godot/drivers/gles3/rasterizer_scene_gles3.cpp:2273)
[4] RasterizerSceneGLES3::render_scene(Ref<RenderSceneBuffers> const&, RendererSceneRender::CameraData const*, RendererSceneRender::CameraData const*, PagedArray<RenderGeometryInstance*> const&, PagedArray<RID> const&, PagedArray<RID> const&, PagedArray<RID> const&, PagedArray<RID> const&, PagedArray<RID> const&, PagedArray<RID> const&, RID, RID, RID, RID, RID, RID, int, float, RendererSceneRender::RenderShadowData const*, int, RendererSceneRender::RenderSDFGIData const*, int, RendererSceneRender::RenderSDFGIUpdateData const*, RenderingMethod::RenderInfo*) (/storage/Code/godot/drivers/gles3/rasterizer_scene_gles3.cpp:1928)
[5] RendererSceneCull::_render_scene(RendererSceneRender::CameraData const*, Ref<RenderSceneBuffers> const&, RID, RID, unsigned int, RID, RID, RID, RID, int, float, bool, RenderingMethod::RenderInfo*) (/storage/Code/godot/servers/rendering/renderer_scene_cull.cpp:3317 (discriminator 4))
[6] RendererSceneCull::render_camera(Ref<RenderSceneBuffers> const&, RID, RID, RID, Vector2, bool, float, RID, Ref<XRInterface>&, RenderingMethod::RenderInfo*) (/storage/Code/godot/servers/rendering/renderer_scene_cull.cpp:2590)
[7] RendererViewport::_draw_3d(RendererViewport::Viewport*) (/storage/Code/godot/servers/rendering/renderer_viewport.cpp:212 (discriminator 1))
[8] RendererViewport::_draw_viewport(RendererViewport::Viewport*) (/storage/Code/godot/servers/rendering/renderer_viewport.cpp:279)
[9] RendererViewport::draw_viewports() (/storage/Code/godot/servers/rendering/renderer_viewport.cpp:729)
[10] RenderingServerDefault::_draw(bool, double) (/storage/Code/godot/servers/rendering/rendering_server_default.cpp:92)
[11] RenderingServerDefault::draw(bool, double) (/storage/Code/godot/servers/rendering/rendering_server_default.cpp:397)
[12] Main::iteration() (/storage/Code/godot/main/main.cpp:3234)
[13] OS_LinuxBSD::run() (/storage/Code/godot/platform/linuxbsd/os_linuxbsd.cpp:889)
[14] ./bin/godot.linuxbsd.editor.dev.x86_64(main+0x15a) [0x4f6d540] (/storage/Code/godot/platform/linuxbsd/godot_linuxbsd.cpp:75)
[15] /lib64/libc.so.6(+0x27510) [0x7f4c0d290510] (??:0)
[16] /lib64/libc.so.6(__libc_start_main+0x89) [0x7f4c0d2905c9] (??:0)
[17] ./bin/godot.linuxbsd.editor.dev.x86_64(_start+0x25) [0x4f6d325] (??:?)
-- END OF BACKTRACE --
================================================================
[1]    15524 IOT instruction (core dumped)  ./bin/godot.linuxbsd.editor.dev.x86_64 
```

### Steps to reproduce

1. Set renderer to "Compatibility"
2. Write the following line in a shader that is assigned to an object through a ShaderMaterial (I've tried it in Spatial and Sky shaders)
   `uniform sampler2D test[5];`


### Minimal reproduction project

N/A
if (version.is_valid()) {
		MaterialStorage::get_singleton()->shaders.canvas_shader.version_free(version);
	}
}
GLES3::ShaderData *GLES3::_create_canvas_shader_func() {
	CanvasShaderData *shader_data = memnew(CanvasShaderData);
	return shader_data;
}
void CanvasMaterialData::update_parameters(const HashMap<StringName, Variant> &p_parameters, bool p_uniform_dirty, bool p_textures_dirty) {
	update_parameters_internal(p_parameters, p_uniform_dirty, p_textures_dirty, shader_data->uniforms, shader_data->ubo_offsets.ptr(), shader_data->texture_uniforms, shader_data->default_texture_params, shader_data->ubo_size);
}
void CanvasMaterialData::bind_uniforms() {
	
	glBindBufferBase(GL_UNIFORM_BUFFER, RasterizerCanvasGLES3::MATERIAL_UNIFORM_LOCATION, uniform_buffer);
	RID *textures = texture_cache.ptrw();
	ShaderCompiler::GeneratedCode::Texture *texture_uniforms = shader_data->texture_uniforms.ptrw();
	for (int ti = 0; ti < texture_cache.size(); ti++) {
		Texture *texture = TextureStorage::get_singleton()->get_texture(textures[ti]);
		glActiveTexture(GL_TEXTURE1 + ti); 
		glBindTexture(target_from_type[texture_uniforms[ti].type], texture->tex_id);
		if (texture->render_target) {
			texture->render_target->used_in_frame = true;
		}
		texture->gl_set_filter(filter_from_uniform_canvas[int(texture_uniforms[ti].filter)]);
		texture->gl_set_repeat(repeat_from_uniform_canvas[int(texture_uniforms[ti].repeat)]);
	}
}
CanvasMaterialData::~CanvasMaterialData() {