[m-dev.] diff: fix cell number bug in base_type_layout.m
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Dec 13 16:23:15 AEDT 1999
Estimated hours taken: 2.5
Fix a bug that caused debugging of tests/debugger/browser_test
to fail when compiled with `-O-1'.
compiler/base_type_layout.m:
Fix a bug: the code to allocate cell numbers here was
doing the equivalent of `return cell_number++',
whereas in other parts of the code, e.g.
in stack_layout__get_next_cell_number
and in code_info__get_next_cell_number,
it was doing the equivalent of `return ++cell_number'.
This inconsistency led to the same cell number being
used for two different cells.
Workspace: /d-drive/home/hg/fjh/ws-hg2/mercury
Index: compiler/base_type_layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/base_type_layout.m,v
retrieving revision 1.49
diff -u -d -r1.49 base_type_layout.m
--- compiler/base_type_layout.m 1999/12/09 17:17:41 1.49
+++ compiler/base_type_layout.m 1999/12/13 05:02:48
@@ -1335,7 +1335,7 @@
list__append(RealArityArg, PseudoArgs1, PseudoArgs),
Pseudo = create(0, [Pseudo0 | PseudoArgs], uniform(no),
- must_be_static, CNum0, "type_layout")
+ must_be_static, CNum1, "type_layout")
;
type_util__var(Type, Var)
->
@@ -1526,7 +1526,7 @@
:- pred base_type_layout__get_next_cell_number(int, layout_info, layout_info).
:- mode base_type_layout__get_next_cell_number(out, in, out) is det.
-base_type_layout__get_next_cell_number(CNum0, LayoutInfo0, LayoutInfo) :-
+base_type_layout__get_next_cell_number(CNum, LayoutInfo0, LayoutInfo) :-
LayoutInfo0 = layout_info(A, B, C, D, CNum0, F, G),
CNum = CNum0 + 1,
LayoutInfo = layout_info(A, B, C, D, CNum, F, G).
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list