Fix unitialized variables in core

This commit is contained in:
Bastien JAUNY 2021-10-10 17:49:50 +02:00 committed by Relintai
parent 08895824aa
commit 15cccb331f
17 changed files with 43 additions and 3 deletions

View File

@ -2606,6 +2606,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

@ -274,6 +274,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

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

View File

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

View File

@ -396,6 +396,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

@ -297,6 +297,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

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

View File

@ -836,6 +836,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

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

View File

@ -1043,7 +1043,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

@ -47,8 +47,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

@ -2227,6 +2227,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

@ -219,7 +219,10 @@ private:
Type type;
ENode() { next = nullptr; }
ENode() {
type = Type::TYPE_INPUT;
next = nullptr;
}
virtual ~ENode() {
if (next) {
memdelete(next);
@ -241,6 +244,7 @@ private:
int index;
InputNode() {
type = TYPE_INPUT;
index = 0;
}
};
@ -258,6 +262,8 @@ private:
OperatorNode() {
type = TYPE_OPERATOR;
nodes[0] = nullptr;
nodes[1] = nullptr;
}
};
@ -273,6 +279,8 @@ private:
IndexNode() {
type = TYPE_INDEX;
base = nullptr;
index = nullptr;
}
};
@ -282,6 +290,7 @@ private:
NamedIndexNode() {
type = TYPE_NAMED_INDEX;
base = nullptr;
}
};
@ -301,6 +310,7 @@ private:
CallNode() {
type = TYPE_CALL;
base = nullptr;
}
};
@ -323,6 +333,7 @@ private:
Vector<ENode *> arguments;
BuiltinFuncNode() {
type = TYPE_BUILTIN_FUNC;
func = BuiltinFunc::MATH_SIN;
}
};

View File

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

View File

@ -475,7 +475,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

@ -385,6 +385,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"] = "";
}

View File

@ -479,6 +479,7 @@ String DirAccess::get_filesystem_abspath_for(String p_path) {
DirAccess::DirAccess() {
_access_type = ACCESS_FILESYSTEM;
next_is_dir = false;
}
DirAccess::~DirAccess() {