Can be reproduced with this command:
srec_cat -generate 0 1 -constant 0 -fill 0xFF 0xFFFFFFFE 0xFFFFFFFF
---
Makefile.in | 7 +++++--
srecord/input/filter/fill.cc | 2 ++
test/02/t0255a.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 2 deletions(-)
create mode 100644 test/02/t0255a.sh
diff --git a/Makefile.in b/Makefile.in
index d2ad740..400b933 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3713,6 +3713,9 @@ t0253a: all test/02/t0253a.sh
t0254a: all test/02/t0254a.sh
PATH=`pwd`/bin:$$PATH $(SH) test/02/t0254a.sh
+t0255a: all test/02/t0255a.sh
+ PATH=`pwd`/bin:$$PATH $(SH) test/02/t0255a.sh
+
test/arglex_ambiguous/main.lo test/arglex_ambiguous/main.o: srecord/arglex.h \
srecord/arglex/tool.h srecord/defcon.h srecord/endian.h \
srecord/format_printf.h srecord/input.h srecord/output.h \
@@ -4154,7 +4157,7 @@ test_files = t0001a t0002a t0003a t0004a t0005a t0006a t0007a t0008a t0009a \
t0206a t0207a t0209a t0210a t0211a t0212a t0213a t0215a t0216a \
t0217a t0218a t0219a t0220a t0221a t0222a t0223a t0225a t0227a \
t0228a t0229a t0230a t0231a t0232a t0233a t0235a t0236a t0237a \
- t0238a t0239a t0250a t0251a t0253a t0254a
+ t0238a t0239a t0250a t0251a t0253a t0254a t0255a
sure: $(test_files)
@echo Passed All Tests
@@ -4818,6 +4821,6 @@ uninstall:
t0207a t0209a t0210a t0211a t0212a t0213a t0215a t0216a t0217a \
t0218a t0219a t0220a t0221a t0222a t0223a t0225a t0227a t0228a \
t0229a t0230a t0231a t0232a t0233a t0235a t0236a t0237a t0238a \
- t0239a t0250a t0251a t0253a t0254a the-default-target
+ t0239a t0250a t0251a t0253a t0254a t0255a the-default-target
# vim: set ts=8 sw=8 noet :
diff --git a/srecord/input/filter/fill.cc b/srecord/input/filter/fill.cc
index ef5801c..ed7d83a 100644
--- a/srecord/input/filter/fill.cc
+++ b/srecord/input/filter/fill.cc
@@ -56,6 +56,8 @@ srecord::input_filter_fill::generate(record &result)
interval::data_t lo = range.get_lowest();
size_t rec_len = record::maximum_data_length(lo);
interval::data_t hi = lo + rec_len;
+ if (hi < lo)
+ hi = 0;
interval chunk(lo, hi);
chunk *= range;
chunk.first_interval_only();
diff --git a/test/02/t0255a.sh b/test/02/t0255a.sh
new file mode 100644
index 0000000..8022b8d
--- /dev/null
+++ b/test/02/t0255a.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# srecord - Manipulate EPROM load files
+# Copyright (C) 2009, 2011, 2012 Peter Miller
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+TEST_SUBJECT="fill near end of address space"
+. test_prelude
+
+cat > test.ok << 'fubar'
+S00600004844521B
+S104000000FB
+S306FFFFFFFEFFFF
+S5030002FA
+fubar
+if test $? -ne 0; then no_result; fi
+
+srec_cat -generate 0 1 -constant 0 -fill 0xFF 0xFFFFFFFE 0xFFFFFFFF \
+ -o test.out -header HDR
+if test $? -ne 0; then fail; fi
+
+diff test.ok test.out
+if test $? -ne 0; then fail; fi
+
+#
+# The things tested here, worked.
+# No other guarantees are made.
+#
+pass
+
+# vim: set ts=8 sw=4 et :
--
2.0.4
|