Merge pull request #53639 from bjauny/fix_uninitMemberVar_core

[3.x] Fix unitialized variables in `core`
This commit is contained in:
Rémi Verschelde 2024-01-05 12:28:14 +01:00 committed by GitHub
commit e22335ec72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 43 additions and 3 deletions

View file

@ -2602,6 +2602,8 @@ void _Directory::_bind_methods() {
_Directory::_Directory() {
d = DirAccess::create(DirAccess::ACCESS_RESOURCES);
_list_skip_navigational = false;
_list_skip_hidden = false;
}
_Directory::~_Directory() {

View file

@ -248,6 +248,7 @@ ClassDB::ClassInfo::ClassInfo() {
inherits_ptr = nullptr;
disabled = false;
exposed = false;
class_ptr = nullptr;
}
ClassDB::ClassInfo::~ClassInfo() {

View file

@ -129,6 +129,7 @@ void HashingContext::_bind_methods() {
HashingContext::HashingContext() {
ctx = nullptr;
type = HashType::HASH_MD5;
}
HashingContext::~HashingContext() {

View file

@ -236,6 +236,7 @@ Engine::Engine() {
_frame_step = 0;
editor_hint = false;
_portals_active = false;
_occlusion_culling_active = false;
}
Engine::Singleton::Singleton(const StringName &p_name, Object *p_ptr) :

View file

@ -395,6 +395,7 @@ Error FileAccessCompressed::_set_unix_permissions(const String &p_file, uint32_t
FileAccessCompressed::FileAccessCompressed() :
cmode(Compression::MODE_ZSTD),
writing(false),
write_pos(0),
write_ptr(nullptr),
write_buffer_size(0),
write_max(0),

View file

@ -296,6 +296,8 @@ Error FileAccessEncrypted::_set_unix_permissions(const String &p_file, uint32_t
FileAccessEncrypted::FileAccessEncrypted() {
file = nullptr;
base = 0;
length = 0;
pos = 0;
eofed = false;
mode = MODE_MAX;

View file

@ -181,4 +181,6 @@ void FileAccessMemory::store_buffer(const uint8_t *p_src, uint64_t p_length) {
FileAccessMemory::FileAccessMemory() {
data = nullptr;
length = 0;
pos = 0;
}

View file

@ -835,6 +835,7 @@ HTTPClient::HTTPClient() {
chunk_trailer_part = false;
response_num = 0;
ssl = false;
ssl_verify_host = false;
blocking = false;
handshaking = false;
// 64 KiB by default (favors fast download speeds at the cost of memory usage).

View file

@ -177,6 +177,7 @@ Error PCKPacker::flush(bool p_verbose) {
PCKPacker::PCKPacker() {
file = nullptr;
alignment = 0;
};
PCKPacker::~PCKPacker() {

View file

@ -937,7 +937,9 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) {
ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() :
translation_remapped(false),
ver_format(0),
f(nullptr),
importmd_ofs(0),
error(OK),
stage(0) {
}

View file

@ -46,8 +46,12 @@ class AStar : public Reference {
struct Point {
Point() :
id(0),
enabled(false),
neighbours(4u),
unlinked_neighbours(4u) {}
unlinked_neighbours(4u),
prev_point(nullptr),
open_pass(0) {}
int id;
Vector3 pos;

View file

@ -2226,6 +2226,8 @@ void Expression::_bind_methods() {
Expression::Expression() :
output_type(Variant::NIL),
sequenced(false),
str_ofs(0),
expression_dirty(false),
error_set(true),
root(nullptr),
nodes(nullptr),

View file

@ -218,7 +218,10 @@ private:
Type type;
ENode() { next = nullptr; }
ENode() {
type = Type::TYPE_INPUT;
next = nullptr;
}
virtual ~ENode() {
if (next) {
memdelete(next);
@ -240,6 +243,7 @@ private:
int index;
InputNode() {
type = TYPE_INPUT;
index = 0;
}
};
@ -257,6 +261,8 @@ private:
OperatorNode() {
type = TYPE_OPERATOR;
nodes[0] = nullptr;
nodes[1] = nullptr;
}
};
@ -272,6 +278,8 @@ private:
IndexNode() {
type = TYPE_INDEX;
base = nullptr;
index = nullptr;
}
};
@ -281,6 +289,7 @@ private:
NamedIndexNode() {
type = TYPE_NAMED_INDEX;
base = nullptr;
}
};
@ -300,6 +309,7 @@ private:
CallNode() {
type = TYPE_CALL;
base = nullptr;
}
};
@ -322,6 +332,7 @@ private:
Vector<ENode *> arguments;
BuiltinFuncNode() {
type = TYPE_BUILTIN_FUNC;
func = BuiltinFunc::MATH_SIN;
}
};

View file

@ -465,7 +465,10 @@ private:
int reference_count;
Connection conn;
List<Connection>::Element *cE;
Slot() { reference_count = 0; }
Slot() {
reference_count = 0;
cE = nullptr;
}
};
MethodInfo user;

View file

@ -448,6 +448,7 @@ bool DirAccess::exists(String p_dir) {
DirAccess::DirAccess() {
_access_type = ACCESS_FILESYSTEM;
next_is_dir = false;
}
DirAccess::~DirAccess() {

View file

@ -400,4 +400,5 @@ int PackedDataContainerRef::size() const {
};
PackedDataContainerRef::PackedDataContainerRef() {
offset = 0;
}

View file

@ -384,6 +384,10 @@ void ScriptDebuggerLocal::send_error(const String &p_func, const String &p_file,
ScriptDebuggerLocal::ScriptDebuggerLocal() {
profiling = false;
frame_time = 0.0f;
process_time = 0.0f;
physics_time = 0.0f;
physics_frame_time = 0.0f;
idle_accum = OS::get_singleton()->get_ticks_usec();
options["variable_prefix"] = "";
}