C++: fix bug in PredictionContext::mergeArrays
In the orignal PredictionContext::mergeArrays there was a bug on Line 281 where the logic differs from java: It currently is: bool both$ = payload == EMPTY_RETURN_STATE && a_parent && b_parent; and should instead match java as: bool both$ = payload == EMPTY_RETURN_STATE && !a_parent && !b_parent;
This commit is contained in:
parent
70d9ddcd0a
commit
27c8eb5c6a
|
@ -209,4 +209,5 @@ YYYY/MM/DD, github id, Full name, email
|
|||
2018/11/12, vinoski, Steve Vinoski, vinoski@ieee.org
|
||||
2018/11/14, nxtstep, Adriaan (Arjan) Duz, codewithadriaan[et]gmail[dot]com
|
||||
2018/11/15, amykyta3, Alex Mykyta, amykyta3@users.noreply.github.com
|
||||
2018/11/29, hannemann-tamas, Ralf Hannemann-Tamas, ralf.ht@gmail.com
|
||||
2018/11/29, hannemann-tamas, Ralf Hannemann-Tamas, ralf.ht@gmail.com
|
||||
2018/12/20, WalterCouto, Walter Couto, WalterCouto@users.noreply.github.com
|
|
@ -278,7 +278,7 @@ Ref<PredictionContext> PredictionContext::mergeArrays(const Ref<ArrayPredictionC
|
|||
// same payload (stack tops are equal), must yield merged singleton
|
||||
size_t payload = a->returnStates[i];
|
||||
// $+$ = $
|
||||
bool both$ = payload == EMPTY_RETURN_STATE && a_parent && b_parent;
|
||||
bool both$ = payload == EMPTY_RETURN_STATE && !a_parent && !b_parent;
|
||||
bool ax_ax = (a_parent && b_parent) && *a_parent == *b_parent; // ax+ax -> ax
|
||||
if (both$ || ax_ax) {
|
||||
mergedParents[k] = a_parent; // choose left
|
||||
|
|
Loading…
Reference in New Issue