1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-02-16 18:30:37 +00:00

Adding the fix code segment in far call bank.

Added the currentBankLocation to the procedure definition.

(cherry picked from commit 0d90caebe8dd528b2a36d1e151f26820e40e70f5)
(cherry picked from commit 8cbf1b5b4bd7f62326e454bbff7ab5456647615d)
This commit is contained in:
Flight_Control 2023-03-26 18:30:09 +02:00
parent 944fbd3021
commit f81c5ce040

View File

@ -588,6 +588,8 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
parameterList.add(paramVar);
}
procedure.setParameters(parameterList);
procedure.setCodeSegment(currentCodeSegment); // When a procedure is defined, the currentCodeSegment is to be set.
procedure.setBankLocation(currentBank); // When a procedure is defined, the currentBank is to be set, or far calls won't work.
// Add return variable
if(!SymbolType.VOID.equals(procedure.getReturnType())) {
final VariableBuilder builder = new VariableBuilder("return", procedure, false, false, procedure.getReturnType(), varDecl.getDeclDirectives(), currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());