Skip to content

Commit d4e345f

Browse files
committed
kernel: use IS_MUTABLE_OBJ in UNB_LIST/ASS_LIST/ASSS_LIST
1 parent 633d1da commit d4e345f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/lists.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ EXPORT_INLINE void UNB_LIST(Obj list, Int pos)
467467
GAP_ASSERT(pos > 0);
468468
UInt tnum = TNUM_OBJ(list);
469469
if (FIRST_LIST_TNUM <= tnum && tnum <= LAST_LIST_TNUM &&
470-
(tnum & IMMUTABLE)) {
470+
!IS_MUTABLE_OBJ(list)) {
471471
ErrorMayQuit("List Unbind: <list> must be a mutable list", 0, 0);
472472
}
473473
(*UnbListFuncs[TNUM_OBJ(list)])(list, pos);
@@ -504,7 +504,7 @@ EXPORT_INLINE void ASS_LIST(Obj list, Int pos, Obj obj)
504504
GAP_ASSERT(obj != 0);
505505
UInt tnum = TNUM_OBJ(list);
506506
if (FIRST_LIST_TNUM <= tnum && tnum <= LAST_LIST_TNUM &&
507-
(tnum & IMMUTABLE)) {
507+
!IS_MUTABLE_OBJ(list)) {
508508
ErrorMayQuit("List Assignment: <list> must be a mutable list", 0, 0);
509509
}
510510
(*AssListFuncs[TNUM_OBJ(list)])(list, pos, obj);
@@ -552,7 +552,7 @@ EXPORT_INLINE void ASSS_LIST(Obj list, Obj poss, Obj objs)
552552
GAP_ASSERT(LEN_LIST(poss) == LEN_LIST(objs));
553553
UInt tnum = TNUM_OBJ(list);
554554
if (FIRST_LIST_TNUM <= tnum && tnum <= LAST_LIST_TNUM &&
555-
(tnum & IMMUTABLE)) {
555+
!IS_MUTABLE_OBJ(list)) {
556556
ErrorMayQuit("List Assignments: <list> must be a mutable list", 0, 0);
557557
}
558558
(*AsssListFuncs[TNUM_OBJ(list)])(list, poss, objs);

tst/testbugfix/2013-03-12-t00285.tst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ Error, List Element: <list> must be a list (not the integer 1)
5555
gap> v{[1..5]}[1] := 1;
5656
Error, List Assignments: <objs> must be a dense list (not the integer 1)
5757
gap> v{[1..5]}{[1..5]}:=ListWithIdenticalEntries(5,[1..5]);
58-
Error, List Assignments: <list> must be a list (not the integer 1)
58+
Error, List Assignments: <list> must be a mutable list

0 commit comments

Comments
 (0)