diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c index 1b5d03b13..108514b51 100644 --- a/src/base/abc/abcUtil.c +++ b/src/base/abc/abcUtil.c @@ -1418,6 +1418,11 @@ int Abc_NodeCompareLevelsIncrease( Abc_Obj_t ** pp1, Abc_Obj_t ** pp2 ) int Abc_NodeCompareLevelsDecrease( Abc_Obj_t ** pp1, Abc_Obj_t ** pp2 ) { int Diff = Abc_ObjRegular(*pp1)->Level - Abc_ObjRegular(*pp2)->Level; + if ( Diff > 0 ) + return -1; + if ( Diff < 0 ) + return 1; + Diff = Abc_ObjRegular(*pp1)->Id - Abc_ObjRegular(*pp2)->Id; if ( Diff > 0 ) return -1; if ( Diff < 0 )