Skip to content

Commit

Permalink
working on issue #509 #510
Browse files Browse the repository at this point in the history
  • Loading branch information
objeck committed Feb 8, 2025
1 parent f47c17a commit fe8b9b7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions core/compiler/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2651,9 +2651,11 @@ void ContextAnalyzer::AnalyzeNewArrayCall(MethodCall* method_call, const int dep
}

// TODO: check for dimension size of 1, looking at type
else if(expressions.size() == 1 && expressions[0]->GetExpressionType() == VAR_EXPR &&
expressions[0]->GetEvalType() && expressions[0]->GetEvalType()->GetDimension() &&
method_call->GetEvalType()) {
else if(method_call->GetEvalType() && expressions.size() == 1 && (expressions[0]->GetExpressionType() == VAR_EXPR || expressions[0]->GetExpressionType() == STAT_ARY_EXPR) && expressions[0]->GetEvalType()) {
if(expressions[0]->GetEvalType()->GetDimension() != 1) {
ProcessError(static_cast<Expression*>(method_call), L"Invalid array cast dimension");
}

Type* left_type = expressions[0]->GetEvalType();
Type* right_type = method_call->GetEvalType();

Expand Down
2 changes: 1 addition & 1 deletion core/compiler/intermediate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5421,7 +5421,7 @@ void IntermediateEmitter::EmitMethodCall(MethodCall* method_call, bool is_nested
if(method_call->GetCallType() == NEW_ARRAY_CALL) {
std::vector<Expression*> expressions = method_call->GetCallingParameters()->GetExpressions();
// array copy constructor
if(expressions.size() == 1 && expressions[0]->GetExpressionType() == VAR_EXPR &&
if(expressions.size() == 1 && (expressions[0]->GetExpressionType() == VAR_EXPR || expressions[0]->GetExpressionType() == STAT_ARY_EXPR) &&
expressions[0]->GetEvalType() && expressions[0]->GetEvalType()->GetDimension()) {

Type* type = method_call->GetArrayType();
Expand Down
2 changes: 1 addition & 1 deletion core/vm/arch/jit/jit_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void JitCompiler::JitStackCallback(const long instr_id, StackInstr* instr, const
break;

case 16:
formatter << std::hex;
formatter << std::hex << L"0x";
break;
}

Expand Down
2 changes: 1 addition & 1 deletion core/vm/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ void StackInterpreter::Int2Str(size_t* &op_stack, long* &stack_pos)
break;

case 16:
formatter << std::hex;
formatter << std::hex << L"0x";
break;
}

Expand Down
Binary file modified docs/api.zip
Binary file not shown.

0 comments on commit fe8b9b7

Please sign in to comment.