@@ -209,7 +209,10 @@ xb_fil_cur_open(
209
209
cursor->buf_size = XB_FIL_CUR_PAGES * cursor->page_size ;
210
210
cursor->buf = static_cast <byte*>(aligned_malloc (cursor->buf_size ,
211
211
srv_page_size));
212
-
212
+ cursor->tmp_page = static_cast <byte*>(aligned_malloc (srv_page_size,
213
+ srv_page_size));
214
+ cursor->tmp_frame = static_cast <byte*>(aligned_malloc (srv_page_size,
215
+ srv_page_size));
213
216
cursor->buf_read = 0 ;
214
217
cursor->buf_npages = 0 ;
215
218
cursor->buf_offset = 0 ;
@@ -237,15 +240,10 @@ xb_fil_cur_open(
237
240
return (XB_FIL_CUR_SUCCESS);
238
241
}
239
242
240
- /* Stack usage 131224 with clang */
241
- PRAGMA_DISABLE_CHECK_STACK_FRAME
242
-
243
243
static bool page_is_corrupted (const byte *page, ulint page_no,
244
244
const xb_fil_cur_t *cursor,
245
245
const fil_space_t *space)
246
246
{
247
- byte tmp_frame[UNIV_PAGE_SIZE_MAX];
248
- byte tmp_page[UNIV_PAGE_SIZE_MAX];
249
247
const ulint page_size = cursor->page_size ;
250
248
uint16_t page_type = fil_page_get_type (page);
251
249
@@ -308,42 +306,43 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
308
306
&& !opt_extended_validation)
309
307
return false ;
310
308
311
- memcpy (tmp_page, page, page_size);
309
+ memcpy (cursor-> tmp_page , page, page_size);
312
310
313
311
if (!space->crypt_data
314
312
|| space->crypt_data ->type == CRYPT_SCHEME_UNENCRYPTED
315
- || !fil_space_decrypt (space, tmp_frame, tmp_page)) {
313
+ || !fil_space_decrypt (space, cursor->tmp_frame ,
314
+ cursor->tmp_page )) {
316
315
return true ;
317
316
}
318
317
319
318
if (page_type != FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
320
- return buf_page_is_corrupted (false , tmp_page,
319
+ return buf_page_is_corrupted (false , cursor-> tmp_page ,
321
320
space->flags );
322
321
}
323
322
}
324
323
325
324
if (page_type == FIL_PAGE_PAGE_COMPRESSED) {
326
- memcpy (tmp_page, page, page_size);
325
+ memcpy (cursor-> tmp_page , page, page_size);
327
326
}
328
327
329
328
if (page_type == FIL_PAGE_PAGE_COMPRESSED
330
329
|| page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
331
- ulint decomp = fil_page_decompress (tmp_frame, tmp_page,
330
+ ulint decomp = fil_page_decompress (cursor->tmp_frame ,
331
+ cursor->tmp_page ,
332
332
space->flags );
333
- page_type = fil_page_get_type (tmp_page);
333
+ page_type = fil_page_get_type (cursor-> tmp_page );
334
334
335
335
return (!decomp
336
336
|| (decomp != srv_page_size
337
337
&& cursor->zip_size )
338
338
|| page_type == FIL_PAGE_PAGE_COMPRESSED
339
339
|| page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED
340
- || buf_page_is_corrupted (false , tmp_page,
340
+ || buf_page_is_corrupted (false , cursor-> tmp_page ,
341
341
space->flags ));
342
342
}
343
343
344
344
return buf_page_is_corrupted (false , page, space->flags );
345
345
}
346
- PRAGMA_REENABLE_CHECK_STACK_FRAME
347
346
348
347
/* * Reads and verifies the next block of pages from the source
349
348
file. Positions the cursor after the last read non-corrupted page.
@@ -507,7 +506,11 @@ xb_fil_cur_close(
507
506
xb_fil_cur_t *cursor) /* !< in/out: source file cursor */
508
507
{
509
508
aligned_free (cursor->buf );
509
+ aligned_free (cursor->tmp_page );
510
+ aligned_free (cursor->tmp_frame );
510
511
cursor->buf = NULL ;
512
+ cursor->tmp_page = NULL ;
513
+ cursor->tmp_frame = NULL ;
511
514
512
515
if (cursor->node != NULL ) {
513
516
xb_fil_node_close_file (cursor->node );
0 commit comments