~ubuntu-branches/ubuntu/oneiric/spl/oneiric

« back to all changes in this revision

Viewing changes to compiler.y

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2010-07-02 01:21:57 UTC
  • mfrom: (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100702012157-wm6ie067a1kisj6d
Tags: 1.0~pre6-2
Brown paper bag release. Really change Build-Depends from libreadline5-dev
to libreadline-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
%{
31
31
 
32
 
#define _GNU_SOURCE
33
 
 
34
32
#include <sys/types.h>
35
33
#include <stdlib.h>
36
34
#include <string.h>
93
91
 
94
92
static int breakcont_label(char type) {
95
93
        char label[100];
96
 
        snprintf(label, 100, "%c%d:%d", type, lbstack_value(), breakcont_value());
 
94
        snprintf(label, sizeof(label), "%c%d:%d", type, lbstack_value(), breakcont_value());
97
95
        if ( spl_asm_setlabel(as, label, spl_asm_add(as, SPL_OP_NOP, 0)) < 0 ) {
98
 
                spl_yyerror("Assembler error"); free(label); return 1;
 
96
                spl_yyerror("Assembler error"); return 1;
99
97
        }
100
98
 
101
99
        return 0;
103
101
 
104
102
static void breakcont_goto(char type) {
105
103
        char label[100];
106
 
        snprintf(label, 100, "%c%d:%d", type, lbstack_value(), breakcont_value());
 
104
        snprintf(label, sizeof(label), "%c%d:%d", type, lbstack_value(), breakcont_value());
107
105
        spl_asm_reflabel(as, label, spl_asm_add(as, SPL_OP_GOTO, 0));
108
106
}
109
107
 
189
187
%token GOTO
190
188
%token BREAK
191
189
%token CONTINUE
192
 
%token SPECIALREF
193
190
%token ARRAYREF
194
191
%token TRY
195
192
%token CATCH