* after version 2.5.33
+** better checking after yyalloc/yyrealloc (resolves bug #1595967)
+
** flex now provides for a libfl_pic.a compiled with position
independent code. Particularly useful when including a flex scanner
in a shared library and with more recent versions of gcc. Thanks to the Debian project for the idea.
header file.
** flex better escapes filenames with special characters in them
-(resolves#1623600)
+ (resolves bug #1623600)
** a memory leak was plugged(resolves bug #1601111)
/* Create the reject buffer large enough to save one state per allowed character. */
if ( ! YY_G(yy_state_buf) )
YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE M4_YY_CALL_LAST_ARG);
+ if ( ! YY_G(yy_state_buf) )
+ YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
]])
if ( ! YY_G(yy_start) )
yy_size_t new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
YY_G(yy_n_chars) += number_to_move;
YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
M4_YY_CALL_LAST_ARG);
+ if ( ! YY_G(yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(YY_G(yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
M4_YY_CALL_LAST_ARG);
+ if ( ! YY_G(yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(YY_G(yy_buffer_stack) + YY_G(yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
(void *) YY_G(yy_start_stack), new_size M4_YY_CALL_LAST_ARG );
if ( ! YY_G(yy_start_stack) )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
+ YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
}
YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START;
/* Allocate enough space for the version and name fields */
bytes = th->th_hsize - 14;
th->th_version = (char *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
+ if ( ! th->th_version )
+ YY_FATAL_ERROR( "out of dynamic memory in yytbl_hdr_read()" );
/* we read it all into th_version, and point th_name into that data */
if (fread (th->th_version, 1, bytes, rd->fp) != bytes){
else
/* We point to the address of a pointer. */
*dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
+ if ( ! p )
+ YY_FATAL_ERROR( "out of dynamic memory in yytbl_data_load()" );
}
/* If it's a struct, we read 2 integers to get one element */