Bug: reading outside of move_diff_code
JoshuaGreen opened this issue · 3 comments
When Popeye is run over BEISPIEL/castling.inp
and BEISPIEL/legalsq.inp
, UndefinedBehaviorSanitizer issues complaints like:
optimisations/orthodox_mating_moves/king_contact_move_generator.c:67:11: runtime error: index 194 out of bounds for type 'const move_diff_type[176]' (aka 'const unsigned int[176]')
#0 0x5635733d042d in orthodox_mating_king_contact_generator_solve /home/joshua/popeye/optimisations/orthodox_mating_moves/king_contact_move_generator.c:67:11
#1 0x5635732bbbc0 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:836:7
#2 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#3 0x5635733c6805 in orthodox_mating_move_generator_solve /home/joshua/popeye/optimisations/orthodox_mating_moves/orthodox_mating_move_generator.c:558:3
#4 0x5635732be153 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:832:7
#5 0x5635734b7800 in fork_solve_delegate /home/joshua/popeye/solving/fork.c:16:3
#6 0x5635734a6fbb in binary_solve_if_then_else /home/joshua/popeye/solving/binary.c:19:5
#7 0x56357347f499 in fork_on_remaining_solve /home/joshua/popeye/solving/fork_on_remaining.c:58:3
#8 0x5635732bcb9b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:849:7
#9 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#10 0x56357349443e in learn_unsolvable_solve /home/joshua/popeye/solving/avoid_unsolvable.c:282:3
#11 0x5635732be78d in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:897:7
#12 0x5635734b718b in pipe_this_move_doesnt_solve_if /home/joshua/popeye/solving/pipe.c:63:5
#13 0x5635734a7263 in dead_end_solve /home/joshua/popeye/solving/dead_end.c:36:3
#14 0x5635732bae88 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:841:7
#15 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#16 0x56357347d7a1 in find_shortest_solve /home/joshua/popeye/solving/find_shortest.c:74:5
#17 0x5635732bb35f in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:680:7
#18 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#19 0x56357345d43e in delegate_can_attack_in_n /home/joshua/popeye/optimisations/hash.c:2289:3
#20 0x56357345d136 in attack_hashed_tester_solve /home/joshua/popeye/optimisations/hash.c:2339:20
#21 0x5635732bb96e in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:861:7
#22 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#23 0x5635734949ad in selfcheck_guard_solve /home/joshua/popeye/solving/selfcheck_guard.c:61:5
#24 0x5635732baeca in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:908:7
#25 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#26 0x5635733d32a8 in killer_defense_collector_solve /home/joshua/popeye/optimisations/killer_move/collector.c:66:3
#27 0x5635732bb3a1 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1482:7
#28 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#29 0x563573494398 in reset_unsolvable_solve /home/joshua/popeye/solving/avoid_unsolvable.c:235:3
#30 0x5635732bec31 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:893:7
#31 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#32 0x5635734a8d4d in defense_played_solve /home/joshua/popeye/solving/move_played.c:63:3
#33 0x5635732bec73 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:2102:7
#34 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#35 0x56357348e3b4 in castling_rights_adjuster_solve /home/joshua/popeye/solving/castling.c:435:3
#36 0x5635732bf0b4 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1647:7
#37 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#38 0x5635736a13f7 in king_square_updater_solve /home/joshua/popeye/position/effects/king_square.c:204:5
#39 0x5635732bcb59 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:2042:7
#40 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#41 0x5635736b5591 in move_counter_solve /home/joshua/popeye/debugging/measure.c:34:3
#42 0x5635732bd7ea in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:823:7
#43 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#44 0x56357352bd74 in en_passant_adjuster_solve /home/joshua/popeye/pieces/walks/pawns/en_passant.c:468:3
#45 0x5635732be7ae in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:732:7
#46 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#47 0x56357352763f in pawn_promoter_solve /home/joshua/popeye/pieces/walks/pawns/promotion.c:309:5
#48 0x5635732bcaf6 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:740:7
#49 0x5635734993d5 in post_move_iteration_solve_recurse /home/joshua/popeye/solving/post_move_iteration.c:131:3
#50 0x563573527679 in pawn_promoter_solve /home/joshua/popeye/pieces/walks/pawns/promotion.c:320:7
#51 0x5635732bcaf6 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:740:7
#52 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#53 0x5635734a93ee in move_player_solve /home/joshua/popeye/solving/move_player.c:59:3
#54 0x5635732bcad5 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:728:7
#55 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#56 0x56357348cd3e in castling_player_solve /home/joshua/popeye/solving/castling.c:130:7
#57 0x5635732bec52 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:724:7
#58 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#59 0x563573499668 in move_execution_post_move_iterator_solve /home/joshua/popeye/solving/post_move_iteration.c:235:3
#60 0x5635732bb425 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:712:7
#61 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#62 0x56357347d2db in move_effect_journal_undoer_solve /home/joshua/popeye/solving/move_effect_journal.c:250:3
#63 0x5635732bc3be in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:716:7
#64 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#65 0x56357348aae0 in find_defense_solve /home/joshua/popeye/solving/find_move.c:139:5
#66 0x5635732bc37c in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:700:7
#67 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#68 0x5635733d7418 in opponent_moves_few_moves_prioriser_solve /home/joshua/popeye/optimisations/count_nr_opponent_moves/prioriser.c:82:3
#69 0x5635732bb635 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1655:7
#70 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#71 0x563573356175 in edgemover_remove_illegal_moves_solve /home/joshua/popeye/conditions/edgemover.c:47:3
#72 0x5635732bbf3b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:2266:7
#73 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#74 0x5635734825e7 in move_generator_solve /home/joshua/popeye/solving/move_generator.c:440:3
#75 0x5635732bed7b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:684:7
#76 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#77 0x5635734a6fc2 in binary_solve_if_then_else /home/joshua/popeye/solving/binary.c:21:5
#78 0x56357347f499 in fork_on_remaining_solve /home/joshua/popeye/solving/fork_on_remaining.c:58:3
#79 0x5635732bcb9b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:849:7
#80 0x5635734b718b in pipe_this_move_doesnt_solve_if /home/joshua/popeye/solving/pipe.c:63:5
#81 0x5635734a7263 in dead_end_solve /home/joshua/popeye/solving/dead_end.c:36:3
#82 0x5635732bae88 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:841:7
#83 0x5635734b7800 in fork_solve_delegate /home/joshua/popeye/solving/fork.c:16:3
#84 0x5635734ba2ff in continuation_solver_solve /home/joshua/popeye/solving/battle_play/continuation.c:49:3
#85 0x5635732bb90b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:2098:7
#86 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#87 0x5635734949ad in selfcheck_guard_solve /home/joshua/popeye/solving/selfcheck_guard.c:61:5
#88 0x5635732baeca in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:908:7
#89 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#90 0x5635734a873e in end_of_branch_goal_solve /home/joshua/popeye/solving/end_of_branch_goal.c:30:5
#91 0x5635732bae25 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:881:7
#92 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#93 0x5635734a6fc2 in binary_solve_if_then_else /home/joshua/popeye/solving/binary.c:21:5
#94 0x5635734942c5 in avoid_unsolvable_solve /home/joshua/popeye/solving/avoid_unsolvable.c:186:3
#95 0x5635732bb014 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:889:7
#96 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#97 0x56357368f11a in output_plaintext_end_of_solution_writer_solve /home/joshua/popeye/output/plaintext/tree/end_of_solution_writer.c:47:3
#98 0x5635732bc96a in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:2114:7
#99 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#100 0x5635734a8b53 in attack_played_solve /home/joshua/popeye/solving/move_played.c:29:3
#101 0x5635732bf19b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:812:7
#102 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#103 0x56357348e3b4 in castling_rights_adjuster_solve /home/joshua/popeye/solving/castling.c:435:3
#104 0x5635732bf0b4 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1647:7
#105 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#106 0x5635736a13f7 in king_square_updater_solve /home/joshua/popeye/position/effects/king_square.c:204:5
#107 0x5635732bcb59 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:2042:7
#108 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#109 0x5635736b5591 in move_counter_solve /home/joshua/popeye/debugging/measure.c:34:3
#110 0x5635732bd7ea in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:823:7
#111 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#112 0x56357352bd74 in en_passant_adjuster_solve /home/joshua/popeye/pieces/walks/pawns/en_passant.c:468:3
#113 0x5635732be7ae in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:732:7
#114 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#115 0x56357352763f in pawn_promoter_solve /home/joshua/popeye/pieces/walks/pawns/promotion.c:309:5
#116 0x5635732bcaf6 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:740:7
#117 0x5635734993d5 in post_move_iteration_solve_recurse /home/joshua/popeye/solving/post_move_iteration.c:131:3
#118 0x563573527679 in pawn_promoter_solve /home/joshua/popeye/pieces/walks/pawns/promotion.c:320:7
#119 0x5635732bcaf6 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:740:7
#120 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#121 0x5635734a93ee in move_player_solve /home/joshua/popeye/solving/move_player.c:59:3
#122 0x5635732bcad5 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:728:7
#123 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#124 0x56357348cd3e in castling_player_solve /home/joshua/popeye/solving/castling.c:130:7
#125 0x5635732bec52 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:724:7
#126 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#127 0x563573499668 in move_execution_post_move_iterator_solve /home/joshua/popeye/solving/post_move_iteration.c:235:3
#128 0x5635732bb425 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:712:7
#129 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#130 0x56357347d2db in move_effect_journal_undoer_solve /home/joshua/popeye/solving/move_effect_journal.c:250:3
#131 0x5635732bc3be in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:716:7
#132 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#133 0x563573489587 in for_each_attack_solve /home/joshua/popeye/solving/for_each_move.c:150:5
#134 0x5635732bb077 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:688:7
#135 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#136 0x5635734825e7 in move_generator_solve /home/joshua/popeye/solving/move_generator.c:440:3
#137 0x5635732bed7b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:684:7
#138 0x5635734b718b in pipe_this_move_doesnt_solve_if /home/joshua/popeye/solving/pipe.c:63:5
#139 0x5635734a7263 in dead_end_solve /home/joshua/popeye/solving/dead_end.c:36:3
#140 0x5635732bae88 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:841:7
#141 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#142 0x563573494398 in reset_unsolvable_solve /home/joshua/popeye/solving/avoid_unsolvable.c:235:3
#143 0x5635732bec31 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:893:7
#144 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#145 0x5635734c58dc in attack_adapter_solve /home/joshua/popeye/solving/battle_play/attack_adapter.c:130:3
#146 0x5635732be9be in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1691:7
#147 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#148 0x56357364f5b1 in output_plaintext_end_of_phase_writer_solve /home/joshua/popeye/output/plaintext/end_of_phase_writer.c:46:3
#149 0x5635732bc949 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1832:7
#150 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#151 0x5635734949ad in selfcheck_guard_solve /home/joshua/popeye/solving/selfcheck_guard.c:61:5
#152 0x5635732baeca in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:908:7
#153 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#154 0x56357364f628 in illegal_selfcheck_writer_solve /home/joshua/popeye/output/plaintext/illegal_selfcheck_writer.c:46:3
#155 0x5635732bd1ec in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1828:7
#156 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#157 0x56357347a517 in retro_play_null_move /home/joshua/popeye/retro/retro.c:29:3
#158 0x5635732bca93 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1720:7
#159 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#160 0x56357347a7dd in retro_start_retro_move_ply /home/joshua/popeye/retro/retro.c:100:3
#161 0x5635732bf072 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1740:7
#162 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#163 0x56357347a5cc in retro_start_retraction_ply /home/joshua/popeye/retro/retro.c:57:3
#164 0x5635732bf17a in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1716:7
#165 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#166 0x5635732bb035 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1877:7
#167 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#168 0x5635735fc3df in proxies_resolve /home/joshua/popeye/stipulation/proxy.c:148:3
#169 0x5635732bbdf1 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:588:7
#170 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#171 0x5635732bfb4c in adjust_slack_length /home/joshua/popeye/solving/machinery/slack_length.c:42:3
#172 0x5635732bf345 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:592:7
#173 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#174 0x5635732c8565 in build_solvers2 /home/joshua/popeye/solving/machinery/solvers.c:824:3
#175 0x5635732bf051 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:584:7
#176 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#177 0x56357364aed0 in output_plaintext_instrument_solving /home/joshua/popeye/output/plaintext/plaintext.c:1027:3
#178 0x5635732bb6b9 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:459:7
#179 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#180 0x56357345ee5e in hash_opener_solve /home/joshua/popeye/optimisations/hash.c:2572:3
#181 0x5635732be853 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:853:7
#182 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#183 0x5635732c4860 in build_solvers1 /home/joshua/popeye/solving/machinery/solvers.c:690:3
#184 0x5635732bf2e5 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:580:7
#185 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#186 0x56357347b2be in move_effect_journal_reset /home/joshua/popeye/solving/move_effect_journal.c:46:3
#187 0x5635732be0cf in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:576:7
#188 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#189 0x5635732dda91 in verify_position /home/joshua/popeye/solving/machinery/twin.c:1927:3
#190 0x5635732bd8b0 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:572:7
#191 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#192 0x5635736b56b0 in counters_writer_solve /home/joshua/popeye/debugging/measure.c:77:3
#193 0x5635732bf363 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:827:7
#194 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#195 0x5635736693fb in output_plaintext_end_of_position_writers_solve /home/joshua/popeye/output/plaintext/position.c:862:3
#196 0x5635732bd1cb in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1816:7
#197 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#198 0x563573667a2e in output_plaintext_write_conditions /home/joshua/popeye/output/plaintext/position.c:657:3
#199 0x5635732bdf01 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1784:7
#200 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#201 0x563573667942 in output_plaintext_write_non_royal_attributes /home/joshua/popeye/output/plaintext/position.c:628:3
#202 0x5635732bd168 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1780:7
#203 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#204 0x5635736665e9 in output_plaintext_write_royal_piece_positions /home/joshua/popeye/output/plaintext/position.c:549:3
#205 0x5635732bd147 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1776:7
#206 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#207 0x563573665f14 in output_plaintext_write_piece_counts /home/joshua/popeye/output/plaintext/position.c:520:3
#208 0x5635732bd105 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1772:7
#209 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#210 0x563573667038 in output_plaintext_write_stipulation /home/joshua/popeye/output/plaintext/position.c:599:3
#211 0x5635732bdee0 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1808:7
#212 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#213 0x5635736656cd in output_plaintext_write_board /home/joshua/popeye/output/plaintext/position.c:491:3
#214 0x5635732bc2f8 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1768:7
#215 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#216 0x5635736655d6 in output_plaintext_write_meta /home/joshua/popeye/output/plaintext/position.c:461:3
#217 0x5635732bd0e4 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:1764:7
#218 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#219 0x5635732e4b1e in initialise_piece_flags_solve /home/joshua/popeye/solving/machinery/twin.c:1943:3
#220 0x5635732bc33a in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:552:7
#221 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#222 0x5635732e2573 in royals_locator_solve /home/joshua/popeye/solving/machinery/twin.c:1935:5
#223 0x5635732bb11c in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:556:7
#224 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#225 0x5635732e636c in pieces_counter_solve /home/joshua/popeye/solving/machinery/twin.c:1949:3
#226 0x5635732bf138 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:548:7
#227 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#228 0x5635732c9814 in piece_walk_caches_initialiser_solve /home/joshua/popeye/solving/machinery/twin.c:115:3
#229 0x5635732baff3 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:544:7
#230 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#231 0x5635732e658c in create_builder_setup_ply_solve /home/joshua/popeye/solving/machinery/twin.c:1961:3
#232 0x5635732bf2c4 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:540:7
#233 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#234 0x5635732ed7d5 in slices_deallocator_solve /home/joshua/popeye/input/plaintext/twin.c:1115:3
#235 0x5635732bbdd0 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:528:7
#236 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#237 0x5635732ed072 in solving_machinery_intro_builder_solve /home/joshua/popeye/input/plaintext/twin.c:1036:3
#238 0x5635732bf00f in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:512:7
#239 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#240 0x56357364b0f2 in output_plaintext_instrument_solving_builder_solve /home/joshua/popeye/output/plaintext/plaintext.c:1047:3
#241 0x5635732be04b in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:455:7
#242 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#243 0x5635732bae67 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:496:7
#244 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#245 0x5635732ed42e in stipulation_copier_solve /home/joshua/popeye/input/plaintext/twin.c:1058:3
#246 0x5635732bb3e3 in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:407:7
#247 0x5635734b72f0 in pipe_solve_delegate /home/joshua/popeye/solving/pipe.c:93:3
#248 0x5635734b996e in phase_solving_incomplete_solve /home/joshua/popeye/solving/incomplete.c:86:3
#249 0x5635732baf6f in dispatch /home/joshua/popeye/solving/machinery/dispatch.c:435:7
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior optimisations/orthodox_mating_moves/king_contact_move_generator.c:67:11 in
What about
if (is_on_board(curr_generation->arrival)
&& move_diff_code[abs(sq_mated_king-curr_generation->arrival)]<=1+1)
in orthodox_mating_king_contact_generator_solve()
Ooh, is_on_board
is a neat macro that I may have to use in other places. :)
I think the distinction here is philosophical, and I'm happy to let you make the call. We already use slack rows and columns so that we don't have to add checks like this throughout the logic, so I went with a change along those lines. However, if it's easy enough to add a check then that's a perfectly reasonable option. I'll rig up a test to see if it works.
(I'll add that, in my testing, I never saw the logic go more than one square off the board. My version was made with that in mind, and I assert
against going farther out. Even with your idea such an assert
ion may be valuable.)