mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-05-01 17:24:34 +00:00
Estimated hours taken: 1
Fix a bug in nondet pragma C codes.
compiler/pragma_c_gen.m:
Fix an off-by-one error that caused the C struct we define
(to hold the items that must be saved from one success of a
nondet pragma C code to the next) to start with the top word
in the next lower nondet stack frame, instead of the word
immediately after that. Therefore an assignment to the first
field of the struct was clobbering the previous stack frame.
tests/hard_coded/nondet_c.{m,exp}:
A new test case to check for this bug.
tests/hard_coded/Mmakefile:
Enable the new test case.
22 lines
168 B
Plaintext
22 lines
168 B
Plaintext
/abcdef
|
|
a/bcdef
|
|
ab/cdef
|
|
abc/def
|
|
abcd/ef
|
|
abcde/f
|
|
abcdef/
|
|
/abcdef
|
|
a/bcdef
|
|
ab/cdef
|
|
abc/def
|
|
abcd/ef
|
|
abcde/f
|
|
abcdef/
|
|
/abcdef
|
|
a/bcdef
|
|
ab/cdef
|
|
abc/def
|
|
abcd/ef
|
|
abcde/f
|
|
abcdef/
|