Opened 18 years ago
Last modified 18 years ago
#114 closed defect (fixed)
function translation error.
Reported by: | Adrian Pop | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Adrian Pop, Adrian Pop |
Description
Change History (2)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Fixed in revision 2737.
The numbering of temporary variables was wrong in Codegen.generateElse.
Note:
See TracTickets
for help on using tickets.
The function below translates wrongly. The script:
loadFile("function-test.mo");
z:=CalcTrapezium(1,1,1,1,0.5,0.5,4,1,0.5);
gives this error (tmp8 is declared twice):
$ ../build/bin/omc function-test.mos
CalcTrapezium.c: In function `_CalcTrapezium':
CalcTrapezium.c:40: error: redeclaration of 'tmp8' with no linkage
CalcTrapezium.c:38: error: previous declaration of 'tmp8' was here
CalcTrapezium.c: In function `_CalcTrapezium':
CalcTrapezium.c:46: error: redeclaration of 'tmp8' with no linkage
CalcTrapezium.c:44: error: previous declaration of 'tmp8' was here
#|Execution failed!
Execution failed!
function-test.mo:
function CalcTrapezium Incomplete!!
protected
algorithm
((decCount+1)*period-tDec2)*dec1
(vel*pv_acc)+((accCount*period)-tAcc1)*acc2
*period*dec2
(vel*pv_dec)+((decCount+1)*period-tDec2)*dec1
end CalcTrapezium;