diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-12-06 16:35:21 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-12-14 06:33:21 +0100 |
commit | 5b65b3d543695cff3c09f5a4db3a857d6e542920 (patch) | |
tree | 5c6fbbc53f070a93bd071551b4554df484571594 /examples | |
parent | 2b52bd1644656955db3211b1807f6adb6bc40172 (diff) | |
download | bison-5b65b3d543695cff3c09f5a4db3a857d6e542920.tar.gz |
glr2.cc: fix pointer arithmethics
A glr_state keeps tracks of its predecessor using an offset relative
to itself (i.e., pointer subtraction). Unfortunately we sometimes
have to compute offsets for pointers that live in different
containers, in particular in yyfillin. In that case there is no
reason for the distance between the two objects to be a multiple of
the object size (0x40 on my machine), and the resulting ptrdiff_t may
be "wrong", i.e., it does allow to recover one from the other. We
cannot use "typed" pointer arithmetics here, the Euclidean division
has it wrong. So use "plain" char* pointers.
Fixes 718 (Duplicate representation of merged trees: glr2.cc) and
examples/c++/glr/c++-types.
Still XFAIL:
712: Improper handling of embedded actions and dollar(-N) in GLR parsers: glr2.cc
730: Incorrectly initialized location for empty right-hand side in GLR: glr2.cc
748: Incorrect lookahead during nondeterministic GLR: glr2.cc
* data/skeletons/glr2.cc (glr_state::as_pointer_): New.
(glr_state::pred): Use it.
* examples/c++/glr/c++-types.test: The test passes.
* tests/glr-regression.at (Duplicate representation of merged trees:
glr2.cc): Passes.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c++/glr/c++-types.test | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/examples/c++/glr/c++-types.test b/examples/c++/glr/c++-types.test index 6f55c8ab..a814d363 100644 --- a/examples/c++/glr/c++-types.test +++ b/examples/c++/glr/c++-types.test @@ -30,8 +30,6 @@ run 0 "\ 5.0-6: <init-declare>(T, x, y) 7.0-4: =(x, y)" -exit 77 - cat >input <<EOF T (x) + y; |