@@ -1110,6 +1110,10 @@ int comp_is_code_array(bc_t *bc, char *p) {
11101110 }
11111111 p ++ ;
11121112 }
1113+ if (* p == '.' ) {
1114+ // a[1].foo is not a code array
1115+ result = 0 ;
1116+ }
11131117 if (!count ) {
11141118 result = 1 ;
11151119 }
@@ -1331,10 +1335,11 @@ void comp_expression(char *expr, byte no_parser) {
13311335 // string
13321336 ptr = bc_store_string (& bc , ptr );
13331337 } else if (* ptr == '[' ) {
1334- // code-defined array
1338+ // potential code-defined array
13351339 ptr ++ ;
13361340 level ++ ;
1337- if (comp_is_code_array (& bc , ptr )) {
1341+ // can't be a code array if this is already part of a variable
1342+ if ((bc .size == 0 || bc .ptr [0 ] != kwTYPE_VAR ) && comp_is_code_array (& bc , ptr )) {
13381343 // otherwise treat as array index
13391344 bc_add_fcode (& bc , kwCODEARRAY );
13401345 }
@@ -3942,29 +3947,6 @@ char *comp_load(const char *file_name) {
39423947 return buf ;
39433948}
39443949
3945- const char * format_numeric_text (const char * str , char * * output ) {
3946- const char * result = str + 1 ;
3947- int value = 0 ;
3948- int digits = 0 ;
3949-
3950- while (isdigit (* result )) {
3951- value = (value << 3 ) + (* result - '0' );
3952- digits ++ ;
3953- result ++ ;
3954- }
3955-
3956- if (digits == 3 && value > V_JOIN_LINE && value < 256 ) {
3957- * * output = value ;
3958- } else {
3959- * * output = * str ;
3960- result = str + 1 ;
3961- }
3962-
3963- (* output )++ ;
3964-
3965- return result ;
3966- }
3967-
39683950/**
39693951 * format source-code text
39703952 *
@@ -4173,9 +4155,6 @@ char *comp_format_text(const char *source) {
41734155 }
41744156 // new line auto-ends the quoted string
41754157 quotes = !quotes ;
4176- } else if (* p == '\\' ) {
4177- p = format_numeric_text (p , & ps );
4178- continue ;
41794158 }
41804159 * ps ++ = * p ++ ;
41814160 }
@@ -4677,6 +4656,7 @@ int comp_pass1(const char *section, const char *text) {
46774656
46784657 char * ps = new_text ;
46794658 char * p = ps ;
4659+ int line_size = 0 ;
46804660 while (* p ) {
46814661 if (* p == '\n' ) {
46824662 // proceed
@@ -4695,11 +4675,17 @@ int comp_pass1(const char *section, const char *text) {
46954675 break ;
46964676 }
46974677 ps = p + 1 ;
4678+ line_size = 0 ;
46984679 }
46994680 if (comp_error ) {
47004681 break ;
47014682 }
47024683 p ++ ;
4684+ if (++ line_size >= SB_SOURCELINE_SIZE ) {
4685+ * p = '\0' ;
4686+ sc_raise (ERR_LINE_LENGTH , p - 50 );
4687+ break ;
4688+ }
47034689 }
47044690 }
47054691
0 commit comments