Repare Bugs
This commit is contained in:
@@ -46,7 +46,7 @@ n_prog *programme() {
|
||||
|
||||
n_l_dec *herite_var = NULL;
|
||||
n_l_dec *herite_func = NULL;
|
||||
n_prog *sreturn;
|
||||
n_prog *sreturn = NULL;
|
||||
|
||||
if( !est_premier( _optDecVariables_, uniteCourante )
|
||||
&& !est_premier( _listeDecFonctions_, uniteCourante )
|
||||
@@ -207,7 +207,7 @@ n_dec * declarationFonction() {
|
||||
n_l_dec *param = NULL;
|
||||
n_l_dec *variables = NULL;
|
||||
n_instr *corps = NULL;
|
||||
n_dec *sreturn;
|
||||
n_dec *sreturn = NULL;
|
||||
if( uniteCourante == ID_FCT ) {
|
||||
name = duplique_chaine(yytext);
|
||||
elementConsome();
|
||||
@@ -371,7 +371,7 @@ n_l_instr *listeInstructions() {
|
||||
|
||||
n_instr *instructionSi() {
|
||||
openSection( __func__ );
|
||||
n_instr *sreturn;
|
||||
n_instr *sreturn = NULL;
|
||||
n_exp *test = NULL;
|
||||
n_instr *alors = NULL;
|
||||
n_instr *sinon = NULL;
|
||||
@@ -401,7 +401,7 @@ n_instr *instructionSi() {
|
||||
|
||||
n_instr *optSinon() {
|
||||
openSection( __func__ );
|
||||
n_instr *sreturn;
|
||||
n_instr *sreturn = NULL;
|
||||
if( uniteCourante == SINON ) {
|
||||
elementConsome();
|
||||
uniteCourante = yylex();
|
||||
@@ -417,9 +417,9 @@ n_instr *optSinon() {
|
||||
|
||||
n_instr *instructionTantque() {
|
||||
openSection( __func__ );
|
||||
n_instr *sreturn;
|
||||
n_exp *test;
|
||||
n_instr *faire;
|
||||
n_instr *sreturn = NULL;
|
||||
n_exp *test = NULL;
|
||||
n_instr *faire = NULL;
|
||||
|
||||
if( uniteCourante == TANTQUE ) {
|
||||
elementConsome();
|
||||
@@ -446,8 +446,8 @@ n_instr *instructionTantque() {
|
||||
|
||||
n_instr *instructionAppel() {
|
||||
openSection( __func__ );
|
||||
n_instr *sreturn;
|
||||
n_appel *app;
|
||||
n_instr *sreturn = NULL;
|
||||
n_appel *app = NULL;
|
||||
if( est_premier( _instructionAppel_, uniteCourante ) ) {
|
||||
app = appelFct();
|
||||
|
||||
@@ -468,8 +468,8 @@ n_instr *instructionAppel() {
|
||||
|
||||
n_instr *instructionRetour() {
|
||||
openSection( __func__ );
|
||||
n_instr *sreturn;
|
||||
n_exp *expr;
|
||||
n_instr *sreturn = NULL;
|
||||
n_exp *expr = NULL;
|
||||
|
||||
if( uniteCourante == RETOUR ) {
|
||||
elementConsome();
|
||||
@@ -623,7 +623,7 @@ n_exp *expressionBis(n_exp *herite) {
|
||||
}
|
||||
|
||||
n_exp *conjonction() {
|
||||
n_exp *sreturn;
|
||||
n_exp *sreturn = NULL;
|
||||
n_exp *herite_neg = NULL;
|
||||
openSection( __func__ );
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ void erreur_1s(char *message, char *s) {
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
char *duplique_chaine(char *src) {
|
||||
char *dest = malloc(sizeof(char) * strlen(src));
|
||||
char *dest = malloc(sizeof(char) * (strlen(src) + 1));
|
||||
strcpy(dest, src);
|
||||
return dest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user