summaryrefslogtreecommitdiff
path: root/src/san.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/san.c')
-rwxr-xr-xsrc/san.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/san.c b/src/san.c
index 725e555..0bb41e4 100755
--- a/src/san.c
+++ b/src/san.c
@@ -319,10 +319,16 @@ Return value:
InitializeLightweightSearcherContext(pos, &ctx);
mv.uMove = 0;
+ // GENERATE_DONT_SCORE: this ctx is a LIGHTWEIGHT_SEARCHER_CONTEXT
+ // cast to the full type -- only safe if GenerateMoves doesn't
+ // touch fields past uPly/sPosition/sPlyInfo/sMoveStack, which
+ // GENERATE_ALL_MOVES/GENERATE_ESCAPES no longer guarantee now
+ // that _ScoreAllMoves/_ScoreAllEscapes read enprise/killer
+ // data off ctx. This caller only wants legality/SAN matching
+ // and never reads .iValue, so skipping scoring is free.
GenerateMoves((SEARCHER_THREAD_CONTEXT *)&ctx,
mv,
- (InCheck(pos, pos->uToMove) ? GENERATE_ESCAPES :
- GENERATE_ALL_MOVES));
+ GENERATE_DONT_SCORE);
for (u = ctx.sMoveStack.uBegin[0];
u < ctx.sMoveStack.uEnd[0];
u++)