aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_compiler.cpp6
-rw-r--r--modules/gdscript/gd_editor.cpp4
-rw-r--r--modules/gdscript/gd_function.cpp2
-rw-r--r--modules/gdscript/gd_parser.cpp8
-rw-r--r--modules/gdscript/gd_script.cpp4
5 files changed, 13 insertions, 11 deletions
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index 959174043..245f44887 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -1310,6 +1310,7 @@ Error GDCompiler::_parse_block(CodeGen &codegen, const GDParser::BlockNode *p_bl
}
} break;
case GDParser::Node::TYPE_ASSERT: {
+#ifdef DEBUG_ENABLED
// try subblocks
const GDParser::AssertNode *as = static_cast<const GDParser::AssertNode *>(s);
@@ -1320,6 +1321,7 @@ Error GDCompiler::_parse_block(CodeGen &codegen, const GDParser::BlockNode *p_bl
codegen.opcodes.push_back(GDFunction::OPCODE_ASSERT);
codegen.opcodes.push_back(ret);
+#endif
} break;
case GDParser::Node::TYPE_BREAKPOINT: {
#ifdef DEBUG_ENABLED
@@ -1537,7 +1539,7 @@ Error GDCompiler::_parse_function(GDScript *p_script, const GDParser::ClassNode
signature += "::0";
}
- //funciton and class
+ //function and class
if (p_class->name) {
signature += "::" + String(p_class->name) + "." + String(func_name);
@@ -1658,7 +1660,7 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
String sub = p_class->extends_class[i];
if (script->subclasses.has(sub)) {
- Ref<Script> subclass = script->subclasses[sub]; //avoid reference from dissapearing
+ Ref<Script> subclass = script->subclasses[sub]; //avoid reference from disappearing
script = subclass;
} else {
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index bd428941e..1499f167c 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -405,7 +405,7 @@ static Ref<Reference> _get_parent_class(GDCompletionContext &context) {
if (script.is_null()) {
return REF();
}
- if (script->is_valid()) {
+ if (!script->is_valid()) {
return REF();
}
@@ -1070,7 +1070,7 @@ static bool _guess_identifier_type(GDCompletionContext &context, int p_line, con
//return _guess_expression_type(context,context._class->variables[i].expression,context._class->variables[i].line,r_type);
}
- //try to guess from assignment in construtor or _ready
+ //try to guess from assignment in constructor or _ready
if (_guess_identifier_from_assignment_in_function(context, p_line + 1, p_identifier, "_ready", r_type))
return true;
if (_guess_identifier_from_assignment_in_function(context, p_line + 1, p_identifier, "_enter_tree", r_type))
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index aaf97001e..0e7ba981f 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -189,7 +189,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
if (p_state) {
//use existing (supplied) state (yielded)
stack = (Variant *)p_state->stack.ptr();
- call_args = (Variant **)stack + sizeof(Variant) * p_state->stack_size;
+ call_args = (Variant **)&p_state->stack.ptr()[sizeof(Variant) * p_state->stack_size]; //ptr() to avoid bounds check
line = p_state->line;
ip = p_state->ip;
alloca_size = p_state->stack.size();
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 86b97e27a..6eb40d533 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -1021,7 +1021,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
OperatorNode::Operator op;
bool valid = true;
-//assign, if allowed is only alowed on the first operator
+//assign, if allowed is only allowed on the first operator
#define _VALIDATE_ASSIGN \
if (!p_allow_assign) { \
_set_error("Unexpected assign."); \
@@ -1253,7 +1253,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
// this is not invalid and can really appear
// but it becomes invalid anyway because no binary op
// can be followed by an unary op in a valid combination,
- // due to how precedence works, unaries will always dissapear first
+ // due to how precedence works, unaries will always disappear first
_set_error("Unexpected two consecutive operators after ternary if.");
return NULL;
@@ -1263,7 +1263,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
// this is not invalid and can really appear
// but it becomes invalid anyway because no binary op
// can be followed by an unary op in a valid combination,
- // due to how precedence works, unaries will always dissapear first
+ // due to how precedence works, unaries will always disappear first
_set_error("Unexpected two consecutive operators after ternary else.");
return NULL;
@@ -1300,7 +1300,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool
// this is not invalid and can really appear
// but it becomes invalid anyway because no binary op
// can be followed by an unary op in a valid combination,
- // due to how precedence works, unaries will always dissapear first
+ // due to how precedence works, unaries will always disappear first
_set_error("Unexpected two consecutive operators.");
return NULL;
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index e1cc75acf..9aafe41a0 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -532,7 +532,7 @@ bool GDScript::_update_exports() {
}
}
} else {
- //print_line("unchaged is "+get_path());
+ //print_line("unchanged is "+get_path());
}
if (base_cache.is_valid()) {
@@ -1271,7 +1271,7 @@ void GDInstance::call_multilevel_reversed(const StringName &p_method, const Vari
void GDInstance::notification(int p_notification) {
- //notification is not virutal, it gets called at ALL levels just like in C.
+ //notification is not virtual, it gets called at ALL levels just like in C.
Variant value = p_notification;
const Variant *args[1] = { &value };