Ticket #1383: hash_seed_option.patch
| File hash_seed_option.patch, 1.9 KB (added by cotto, 3 years ago) |
|---|
-
src/string/api.c
290 290 if (interp->parent_interpreter) { 291 291 interp->hash_seed = interp->parent_interpreter->hash_seed; 292 292 } 293 else { 293 /* interp is initialized from zeroed memory, so this is fine */ 294 else if (interp->hash_seed == 0) { 294 295 /* TT #64 - use an entropy source once available */ 295 296 Parrot_srand(Parrot_intval_time()); 296 297 interp->hash_seed = Parrot_uint_rand(0); -
compilers/imcc/main.c
218 218 " -h --help\n" 219 219 " -V --version\n" 220 220 " -I --include add path to include search\n" 221 " -H --hash-seed specify hex value to use as hash seed\n" 221 222 " -L --library add path to library search\n" 222 223 " -X --dynext add path to dynamic extension search\n" 223 224 " <Run core options>\n" … … 292 293 { 'D', 'D', OPTION_optional_FLAG, { "--parrot-debug" } }, 293 294 { 'E', 'E', (OPTION_flags)0, { "--pre-process-only" } }, 294 295 { 'G', 'G', (OPTION_flags)0, { "--no-gc" } }, 296 { 'H', 'H', OPTION_required_FLAG, { "--hash-seed" } }, 295 297 { 'I', 'I', OPTION_required_FLAG, { "--include" } }, 296 298 { 'L', 'L', OPTION_required_FLAG, { "--library" } }, 297 299 { 'O', 'O', OPTION_optional_FLAG, { "--optimize" } }, … … 427 429 case 'G': 428 430 IMCC_INFO(interp)->gc_off = 1; 429 431 break; 432 case 'H': 433 if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) { 434 interp->hash_seed = strtoul(opt.opt_arg, NULL, 16); 435 } 436 break; 430 437 case '.': /* Give Windows Parrot hackers an opportunity to 431 438 * attach a debuggger. */ 432 439 fgetc(stdin);
