Skip to content

Commit 5bd1ec9

Browse files
committed
Cache Reed-Solomon coefficients readonly
The coefficient arrays delivered by the gencoeffs procedures are shared across calls via the FIFO caches, so mark them readonly.
1 parent 7abd516 commit 5bd1ec9

10 files changed

Lines changed: 10 additions & 10 deletions

src/azteccode.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ begin
259259
%
260260
[ rsnc 1 sub -1 0 {
261261
coeffs exch get dup 0 ne { rslog exch get } { pop -1 } ifelse
262-
} for ]
262+
} for ] readonly
263263
} bind def
264264

265265
/azteccode.coeffscache azteccode.coeffscachemax azteccode.coeffscachelimit //fifocache exec def

src/codeone.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ begin
354354
%
355355
[ ecpb 1 sub -1 0 {
356356
coeffs exch get dup 0 ne { rslog exch get } { pop -1 } ifelse
357-
} for ]
357+
} for ] readonly
358358
} bind def
359359

360360
%

src/datamatrix.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ begin
343343
%
344344
[ k 1 sub -1 0 {
345345
coeffs exch get dup 0 ne { rslog exch get } { pop -1 } ifelse
346-
} for ]
346+
} for ] readonly
347347
} bind def
348348

349349
%

src/dotcode.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ begin
221221
% Drop the leading 1, delivering the coefficients reversed as rsecprime
222222
% requires
223223
1 1 NC { coeffs exch get } for
224-
NC array astore
224+
NC array astore readonly
225225
} bind def
226226

227227
%

src/hanxin.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ begin
570570
%
571571
[ rsnc 1 sub -1 0 {
572572
coeffs exch get dup 0 ne { rslog exch get } { pop -1 } ifelse
573-
} for ]
573+
} for ] readonly
574574
} bind def
575575

576576
%

src/maxicode.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ begin
250250
%
251251
[ k 1 sub -1 0 {
252252
coeffs exch get dup 0 ne { rslog exch get } { pop -1 } ifelse
253-
} for ]
253+
} for ] readonly
254254
} bind def
255255

256256
%

src/micropdf417.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ begin
568568
%
569569
% Deliver the coefficients reversed, as rsecprime requires
570570
%
571-
[ k 1 sub -1 0 { coeffs exch get } for ]
571+
[ k 1 sub -1 0 { coeffs exch get } for ] readonly
572572
} bind def
573573

574574
%

src/pdf417.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ begin
437437
%
438438
% Deliver the coefficients reversed, as rsecprime requires
439439
%
440-
[ k 1 sub -1 0 { coeffs exch get } for ]
440+
[ k 1 sub -1 0 { coeffs exch get } for ] readonly
441441
} bind def
442442

443443
%

src/qrcode.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ begin
674674
%
675675
[ ecpb 1 sub -1 0 {
676676
coeffs exch get dup 0 ne { rslog exch get } { pop -1 } ifelse
677-
} for ]
677+
} for ] readonly
678678
} bind def
679679

680680
%

src/ultracode.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ begin
200200
%
201201
% Deliver the coefficients reversed, as rsecprime requires
202202
%
203-
[ k 1 sub -1 0 { coeffs exch get } for ]
203+
[ k 1 sub -1 0 { coeffs exch get } for ] readonly
204204
} bind def
205205

206206
%

0 commit comments

Comments
 (0)