• R/O
  • SSH
  • HTTPS

jpl: Commit


Commit MetaInfo

Révision407 (tree)
l'heure2019-01-14 05:08:49
Auteurjakobthomsen

Message de Log

reduce check to verify finity when matching enums in recursive function

Change Summary

Modification

--- trunk/pragmatic/compiler.compiled.c (revision 406)
+++ trunk/pragmatic/compiler.compiled.c (revision 407)
@@ -30788,15 +30788,14 @@
3078830788 }
3078930789 else
3079030790 {
30791+ struct string _parid; memset(&_parid, 0, sizeof(struct string));
30792+ {
30793+ GenPar$(&_parid, &*tmpnr);
30794+ }
3079130795 struct qtypepureid _elem; memset(&_elem, 0, sizeof(struct qtypepureid));
3079230796 {
3079330797 const struct qtypepure *_7 = &(*content).qt;
30794- struct string _8; memset(&_8, 0, sizeof(struct string));
30795- {
30796- GenPar$(&_8, &*tmpnr);
30797- }
30798- qtypepureid(&_elem, &*_7, &_8);
30799- string$dest(&_8);
30798+ qtypepureid(&_elem, &*_7, &_parid);
3080030799 }
3080130800 {
3080230801 const struct StreamOut *_8 = &(*streams).out;
@@ -30845,10 +30844,37 @@
3084530844 PutStr(0 /* _13 */, &*_14, &_15);
3084630845 string$dest(&_15);
3084730846 }
30847+ struct stack/*ReducedId*/ _redid; memset(&_redid, 0, sizeof(struct stack/*ReducedId*/));
30848+ clone$(&_redid, &(*reduced_ids), sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy);
30849+ const struct stack/*ReducedId*/ *_14 = &(_redid);
30850+ for(uint64_t _15 = 0; _15 < (*_14).fill; ++_15)
3084830851 {
30849- ParseMatch$(0 /* _14 */, &*streams, &*txtpos, &*structs, &*level, &*sp, &*tmpnr, &_elem, &*casenr, &*ti, &_content_, &*usedids, &*reduced_ids);
30852+ const struct ReducedId *redid = &((struct ReducedId *)((*_14).data))[_15];
30853+ bool _17;
30854+ {
30855+ const struct string *_18 = &(*redid).reduced;
30856+ const struct string *_19 = &(*par).id;
30857+ strequ(&_17, &*_18, &*_19);
30858+ }
30859+ if(_17)
30860+ {
30861+ {
30862+ struct ReducedId _19; memset(&_19, 0, sizeof(struct ReducedId));
30863+ {
30864+ const struct string *_20 = &(*redid).orig;
30865+ ReducedId(&_19, &*_20, &_parid);
30866+ }
30867+ push(0 /* _18 */, &*reduced_ids, &_19, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 6410);
30868+ ReducedId$dest(&_19);
30869+ }
30870+ }
3085030871 }
30872+ {
30873+ ParseMatch$(0 /* _16 */, &*streams, &*txtpos, &*structs, &*level, &*sp, &*tmpnr, &_elem, &*casenr, &*ti, &_content_, &*usedids, &*reduced_ids);
30874+ }
30875+ free$(&_redid, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest);
3085130876 qtypepureid$dest(&_elem);
30877+ string$dest(&_parid);
3085230878 }
3085330879 }
3085430880 free$(&_content_, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest);
@@ -30918,7 +30944,7 @@
3091830944 }
3091930945 }
3092030946 {
30921- push(0 /* _7 */, &*usedids, &_parid, sizeof(struct string), (void (*)(void *))string$dest, (void (*)(void *, const void *))string$copy, 6432);
30947+ push(0 /* _7 */, &*usedids, &_parid, sizeof(struct string), (void (*)(void *))string$dest, (void (*)(void *, const void *))string$copy, 6442);
3092230948 }
3092330949 struct qtypepureid _qti; memset(&_qti, 0, sizeof(struct qtypepureid));
3092430950 {
@@ -30988,7 +31014,7 @@
3098831014 const struct string *_19 = &(*redid).orig;
3098931015 ReducedId(&_18, &*_19, &_parid);
3099031016 }
30991- push(0 /* _17 */, &*reduced_ids, &_18, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 6442);
31017+ push(0 /* _17 */, &*reduced_ids, &_18, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 6452);
3099231018 ReducedId$dest(&_18);
3099331019 }
3099431020 }
@@ -30999,7 +31025,7 @@
3099931025 {
3100031026 varinit(&_17, &_qti);
3100131027 }
31002- push(0 /* _15 */, &*_16, &_17, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 6446);
31028+ push(0 /* _15 */, &*_16, &_17, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 6456);
3100331029 var$dest(&_17);
3100431030 }
3100531031 free$(&_redid, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest);
@@ -31310,7 +31336,7 @@
3131031336 struct typepureid _elem; memset(&_elem, 0, sizeof(struct typepureid));
3131131337 {
3131231338 const struct stack/*typepureid*/ *_35 = &(*f).elems;
31313- at_get$(&_elem, &*_35, &*idx, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 6508);
31339+ at_get$(&_elem, &*_35, &*idx, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 6518);
3131431340 }
3131531341 {
3131631342 struct qtypepureid _35; memset(&_35, 0, sizeof(struct qtypepureid));
@@ -31380,7 +31406,7 @@
3138031406 struct stack/*qtypepureid*/ _43; memset(&_43, 0, sizeof(struct stack/*qtypepureid*/));
3138131407 struct stack/*qtypepureid*/ *parids = &_43;
3138231408 {
31383- push(0 /* _44 */, &*parids, &*elem, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6513);
31409+ push(0 /* _44 */, &*parids, &*elem, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6523);
3138431410 }
3138531411 {
3138631412 ParseMatch$(0 /* _45 */, &*streams, &*txtpos, &*structs, &*level, &*sp, &*tmpnr, &*elem, &*casenr, &*ti, &*parids, &*usedids, &*reduced_ids);
@@ -31568,7 +31594,7 @@
3156831594 struct constr _constr; memset(&_constr, 0, sizeof(struct constr));
3156931595 {
3157031596 const struct stack/*constr*/ *_37 = &(*f).constrs;
31571- at_get$(&_constr, &*_37, &*idx, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 6539);
31597+ at_get$(&_constr, &*_37, &*idx, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 6549);
3157231598 }
3157331599 struct qtypepureid _sub; memset(&_sub, 0, sizeof(struct qtypepureid));
3157431600 {
@@ -31585,11 +31611,7 @@
3158531611 }
3158631612 struct string _38; memset(&_38, 0, sizeof(struct string));
3158731613 {
31588- uint8_t _39; memset(&_39, 0, sizeof(uint8_t));
31589- _39 = 42;
31590- const struct string *_40 = &(_constr).ti.id;
31591- preapp(&_38, &_39, &*_40);
31592- _IGNORE_(_39);
31614+ GenPar$(&_38, &*tmpnr);
3159331615 }
3159431616 qtypepureid(&_sub, &_37, &_38);
3159531617 string$dest(&_38);
@@ -31641,16 +31663,26 @@
3164131663 PutStr(0 /* _43 */, &*_44, &_45);
3164231664 string$dest(&_45);
3164331665 }
31666+ {
31667+ struct ReducedId _45; memset(&_45, 0, sizeof(struct ReducedId));
31668+ {
31669+ const struct string *_46 = &(*par).id;
31670+ const struct string *_47 = &(_sub).id;
31671+ ReducedId(&_45, &*_46, &*_47);
31672+ }
31673+ push(0 /* _44 */, &*reduced_ids, &_45, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 6552);
31674+ ReducedId$dest(&_45);
31675+ }
3164431676 struct stack/*typepureid*/ _elems; memset(&_elems, 0, sizeof(struct stack/*typepureid*/));
3164531677 clone$(&_elems, &(_constr).elems, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy);
3164631678 {
31647- ParseMatchStruct$(0 /* _44 */, &*streams, &*txtpos, &*structs, &*level, &*sp, &*tmpnr, &_sub, &*casenr, &*ti, &*usedids, &_elems, &*reduced_ids);
31679+ ParseMatchStruct$(0 /* _45 */, &*streams, &*txtpos, &*structs, &*level, &*sp, &*tmpnr, &_sub, &*casenr, &*ti, &*usedids, &_elems, &*reduced_ids);
3164831680 }
3164931681 {
31650- uint8_t _46; memset(&_46, 0, sizeof(uint8_t));
31651- _46 = 41;
31652- AssertGet$(0 /* _45 */, &*streams, &*txtpos, &*level, &_46);
31653- _IGNORE_(_46);
31682+ uint8_t _47; memset(&_47, 0, sizeof(uint8_t));
31683+ _47 = 41;
31684+ AssertGet$(0 /* _46 */, &*streams, &*txtpos, &*level, &_47);
31685+ _IGNORE_(_47);
3165431686 }
3165531687 free$(&_elems, sizeof(struct typepureid), (void (*)(void *))typepureid$dest);
3165631688 qtypepureid$dest(&_sub);
@@ -32024,7 +32056,7 @@
3202432056 struct stack/*qtypepureid*/ _35; memset(&_35, 0, sizeof(struct stack/*qtypepureid*/));
3202532057 struct stack/*qtypepureid*/ *parids = &_35;
3202632058 {
32027- push(0 /* _36 */, &*parids, &_elem, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6587);
32059+ push(0 /* _36 */, &*parids, &_elem, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6598);
3202832060 }
3202932061 {
3203032062 struct ReducedId _38; memset(&_38, 0, sizeof(struct ReducedId));
@@ -32033,7 +32065,7 @@
3203332065 const struct string *_40 = &(_elem).id;
3203432066 ReducedId(&_38, &*_39, &*_40);
3203532067 }
32036- push(0 /* _37 */, &*reduced_ids, &_38, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 6588);
32068+ push(0 /* _37 */, &*reduced_ids, &_38, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 6599);
3203732069 ReducedId$dest(&_38);
3203832070 }
3203932071 {
@@ -32302,7 +32334,7 @@
3230232334 {
3230332335 struct stack/*par*/ _2; memset(&_2, 0, sizeof(struct stack/*par*/));
3230432336 {
32305- stack(&_2, sizeof(struct par), (void (*)(void *))par$dest, (void (*)(void *, const void *))par$copy, 6639);
32337+ stack(&_2, sizeof(struct par), (void (*)(void *))par$dest, (void (*)(void *, const void *))par$copy, 6650);
3230632338 }
3230732339 pscope(&_1, &_2);
3230832340 free$(&_2, sizeof(struct par), (void (*)(void *))par$dest);
@@ -32309,13 +32341,13 @@
3230932341 }
3231032342 struct stack/*vscope*/ _2; memset(&_2, 0, sizeof(struct stack/*vscope*/));
3231132343 {
32312- stack(&_2, sizeof(struct vscope), (void (*)(void *))vscope$dest, (void (*)(void *, const void *))vscope$copy, 6639);
32344+ stack(&_2, sizeof(struct vscope), (void (*)(void *))vscope$dest, (void (*)(void *, const void *))vscope$copy, 6650);
3231332345 }
3231432346 struct vscope _3; memset(&_3, 0, sizeof(struct vscope));
3231532347 {
3231632348 struct stack/*var*/ _4; memset(&_4, 0, sizeof(struct stack/*var*/));
3231732349 {
32318- stack(&_4, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 6639);
32350+ stack(&_4, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 6650);
3231932351 }
3232032352 vscope(&_3, &_4);
3232132353 free$(&_4, sizeof(struct var), (void (*)(void *))var$dest);
@@ -32432,7 +32464,7 @@
3243232464 {
3243332465 struct stack/*flavour*/ _10; memset(&_10, 0, sizeof(struct stack/*flavour*/));
3243432466 {
32435- /*UNION*/ empty(&_10, sizeof(struct flavour), (void (*)(void *))flavour$dest, (void (*)(void *, const void *))flavour$copy, 6675);
32467+ /*UNION*/ empty(&_10, sizeof(struct flavour), (void (*)(void *))flavour$dest, (void (*)(void *, const void *))flavour$copy, 6686);
3243632468 }
3243732469 bool _11; memset(&_11, 0, sizeof(bool));
3243832470 _11 = 0;
@@ -32442,7 +32474,7 @@
3244232474 }
3244332475 {
3244432476 struct stack/*structdef*/ *_11 = &(*state).structs;
32445- push(0 /* _10 */, &*_11, &_strdecl, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 6676);
32477+ push(0 /* _10 */, &*_11, &_strdecl, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 6687);
3244632478 }
3244732479 {
3244832480 const struct StreamOut *_12 = &(*streams).out;
@@ -32626,7 +32658,7 @@
3262632658 {
3262732659 struct stack/*flavour*/ _11; memset(&_11, 0, sizeof(struct stack/*flavour*/));
3262832660 {
32629- /*STRUCT*/ empty(&_11, sizeof(struct flavour), (void (*)(void *))flavour$dest, (void (*)(void *, const void *))flavour$copy, 6729);
32661+ /*STRUCT*/ empty(&_11, sizeof(struct flavour), (void (*)(void *))flavour$dest, (void (*)(void *, const void *))flavour$copy, 6740);
3263032662 }
3263132663 bool _12; memset(&_12, 0, sizeof(bool));
3263232664 _12 = 0;
@@ -32636,7 +32668,7 @@
3263632668 }
3263732669 {
3263832670 struct stack/*structdef*/ *_12 = &(*state).structs;
32639- push(0 /* _11 */, &*_12, &_strdecl, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 6730);
32671+ push(0 /* _11 */, &*_12, &_strdecl, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 6741);
3264032672 }
3264132673 {
3264232674 const struct StreamOut *_13 = &(*streams).err;
@@ -32815,7 +32847,7 @@
3281532847 {
3281632848 struct stack/*flavour*/ _10; memset(&_10, 0, sizeof(struct stack/*flavour*/));
3281732849 {
32818- /*STRUCT*/ empty(&_10, sizeof(struct flavour), (void (*)(void *))flavour$dest, (void (*)(void *, const void *))flavour$copy, 6783);
32850+ /*STRUCT*/ empty(&_10, sizeof(struct flavour), (void (*)(void *))flavour$dest, (void (*)(void *, const void *))flavour$copy, 6794);
3281932851 }
3282032852 bool _11; memset(&_11, 0, sizeof(bool));
3282132853 _11 = 0;
@@ -32825,7 +32857,7 @@
3282532857 }
3282632858 {
3282732859 struct stack/*structdef*/ *_11 = &(*state).structs;
32828- push(0 /* _10 */, &*_11, &_strdecl, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 6784);
32860+ push(0 /* _10 */, &*_11, &_strdecl, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 6795);
3282932861 }
3283032862 {
3283132863 const struct StreamOut *_12 = &(*streams).out;
@@ -33046,7 +33078,7 @@
3304633078 struct stack/*qtypepure*/ _parids; memset(&_parids, 0, sizeof(struct stack/*qtypepure*/));
3304733079 {
3304833080 const struct qtypepure *_16 = &(_par).qt;
33049- push(0 /* _15 */, &_parids, &*_16, sizeof(struct qtypepure), (void (*)(void *))qtypepure$dest, (void (*)(void *, const void *))qtypepure$copy, 6829);
33081+ push(0 /* _15 */, &_parids, &*_16, sizeof(struct qtypepure), (void (*)(void *))qtypepure$dest, (void (*)(void *, const void *))qtypepure$copy, 6840);
3305033082 }
3305133083 while(1)
3305233084 {
@@ -33096,7 +33128,7 @@
3309633128 }
3309733129 const struct qtypepure *par = &_20;
3309833130 {
33099- push(0 /* _21 */, &_parids, &*par, sizeof(struct qtypepure), (void (*)(void *))qtypepure$dest, (void (*)(void *, const void *))qtypepure$copy, 6836);
33131+ push(0 /* _21 */, &_parids, &*par, sizeof(struct qtypepure), (void (*)(void *))qtypepure$dest, (void (*)(void *, const void *))qtypepure$copy, 6847);
3310033132 }
3310133133 qtypepure$dest(&_20);
3310233134 }
@@ -33173,7 +33205,7 @@
3317333205 }
3317433206 struct stack/*qtypepureid*/ _parids; memset(&_parids, 0, sizeof(struct stack/*qtypepureid*/));
3317533207 {
33176- push(0 /* _21 */, &_parids, &_par, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6857);
33208+ push(0 /* _21 */, &_parids, &_par, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6868);
3317733209 }
3317833210 while(1)
3317933211 {
@@ -33223,7 +33255,7 @@
3322333255 }
3322433256 const struct qtypepureid *par = &_26;
3322533257 {
33226- push(0 /* _27 */, &_parids, &*par, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6865);
33258+ push(0 /* _27 */, &_parids, &*par, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6876);
3322733259 }
3322833260 qtypepureid$dest(&_26);
3322933261 }
@@ -33308,7 +33340,7 @@
3330833340 {
3330933341 struct stack/*qtypepureid*/ _20; memset(&_20, 0, sizeof(struct stack/*qtypepureid*/));
3331033342 {
33311- stack(&_20, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6887);
33343+ stack(&_20, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6898);
3331233344 }
3331333345 fnpartypeids(&_19, &_20);
3331433346 free$(&_20, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest);
@@ -33424,7 +33456,7 @@
3342433456 {
3342533457 struct stack/*qtypepureid*/ _18; memset(&_18, 0, sizeof(struct stack/*qtypepureid*/));
3342633458 {
33427- stack(&_18, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6903);
33459+ stack(&_18, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 6914);
3342833460 }
3342933461 fnpartypeids(&_17, &_18);
3343033462 free$(&_18, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest);
@@ -33469,7 +33501,7 @@
3346933501 qtype(&_17, &*_18, &_19);
3347033502 type$dest(&_19);
3347133503 }
33472- push(0 /* _16 */, &_pars, &_17, sizeof(struct qtype), (void (*)(void *))qtype$dest, (void (*)(void *, const void *))qtype$copy, 6916);
33504+ push(0 /* _16 */, &_pars, &_17, sizeof(struct qtype), (void (*)(void *))qtype$dest, (void (*)(void *, const void *))qtype$copy, 6927);
3347333505 qtype$dest(&_17);
3347433506 }
3347533507 }
@@ -33761,7 +33793,7 @@
3376133793 {
3376233794 struct stack/*par*/ _19; memset(&_19, 0, sizeof(struct stack/*par*/));
3376333795 {
33764- stack(&_19, sizeof(struct par), (void (*)(void *))par$dest, (void (*)(void *, const void *))par$copy, 6977);
33796+ stack(&_19, sizeof(struct par), (void (*)(void *))par$dest, (void (*)(void *, const void *))par$copy, 6988);
3376533797 }
3376633798 pscope(&_18, &_19);
3376733799 free$(&_19, sizeof(struct par), (void (*)(void *))par$dest);
@@ -33768,13 +33800,13 @@
3376833800 }
3376933801 struct stack/*vscope*/ _19; memset(&_19, 0, sizeof(struct stack/*vscope*/));
3377033802 {
33771- stack(&_19, sizeof(struct vscope), (void (*)(void *))vscope$dest, (void (*)(void *, const void *))vscope$copy, 6977);
33803+ stack(&_19, sizeof(struct vscope), (void (*)(void *))vscope$dest, (void (*)(void *, const void *))vscope$copy, 6988);
3377233804 }
3377333805 struct vscope _20; memset(&_20, 0, sizeof(struct vscope));
3377433806 {
3377533807 struct stack/*var*/ _21; memset(&_21, 0, sizeof(struct stack/*var*/));
3377633808 {
33777- stack(&_21, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 6977);
33809+ stack(&_21, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 6988);
3377833810 }
3377933811 vscope(&_20, &_21);
3378033812 free$(&_21, sizeof(struct var), (void (*)(void *))var$dest);
@@ -34701,7 +34733,7 @@
3470134733 varinit(&_60, &_61);
3470234734 qtypepureid$dest(&_61);
3470334735 }
34704- push(0 /* _58 */, &*_59, &_60, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 7162);
34736+ push(0 /* _58 */, &*_59, &_60, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 7173);
3470534737 var$dest(&_60);
3470634738 }
3470734739 {
@@ -34786,7 +34818,7 @@
3478634818 varinit(&_71, &_72);
3478734819 qtypepureid$dest(&_72);
3478834820 }
34789- push(0 /* _69 */, &*_70, &_71, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 7170);
34821+ push(0 /* _69 */, &*_70, &_71, sizeof(struct var), (void (*)(void *))var$dest, (void (*)(void *, const void *))var$copy, 7181);
3479034822 var$dest(&_71);
3479134823 }
3479234824 {
@@ -34849,7 +34881,7 @@
3484934881 const struct string *_33 = &(_ti).id;
3485034882 struct stack/*ReducedId*/ _34; memset(&_34, 0, sizeof(struct stack/*ReducedId*/));
3485134883 {
34852- stack(&_34, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 7178);
34884+ stack(&_34, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 7189);
3485334885 }
3485434886 ParseExpr2$(0 /* _32 */, &*streams, &*txtpos, &*state, &_level, &_sp, &_tmpnr, &_store, &_totality, &_action, &*_33, &_34);
3485534887 free$(&_34, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest);
@@ -34893,13 +34925,13 @@
3489334925 qtypepureid(&_34, &_35, &*_36);
3489434926 qtypepure$dest(&_35);
3489534927 }
34896- solid(&_33, &_34, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 7184);
34928+ solid(&_33, &_34, sizeof(struct qtypepureid), (void (*)(void *))qtypepureid$dest, (void (*)(void *, const void *))qtypepureid$copy, 7195);
3489734929 qtypepureid$dest(&_34);
3489834930 }
3489934931 const struct string *_34 = &(_ti).id;
3490034932 struct stack/*ReducedId*/ _35; memset(&_35, 0, sizeof(struct stack/*ReducedId*/));
3490134933 {
34902- stack(&_35, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 7184);
34934+ stack(&_35, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest, (void (*)(void *, const void *))ReducedId$copy, 7195);
3490334935 }
3490434936 ParseBlock$(0 /* _32 */, &*streams, &*txtpos, &*state, &_level, &_sp, &_tmpnr, &_33, &_totality, &_action, &*_34, &_35);
3490534937 free$(&_35, sizeof(struct ReducedId), (void (*)(void *))ReducedId$dest);
@@ -35232,11 +35264,11 @@
3523235264 {
3523335265 struct stack/*def*/ _1; memset(&_1, 0, sizeof(struct stack/*def*/));
3523435266 {
35235- stack(&_1, sizeof(struct def), (void (*)(void *))def$dest, (void (*)(void *, const void *))def$copy, 7275);
35267+ stack(&_1, sizeof(struct def), (void (*)(void *))def$dest, (void (*)(void *, const void *))def$copy, 7286);
3523635268 }
3523735269 struct stack/*structdef*/ _2; memset(&_2, 0, sizeof(struct stack/*structdef*/));
3523835270 {
35239- stack(&_2, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 7275);
35271+ stack(&_2, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 7286);
3524035272 }
3524135273 state(&_state, &_1, &_2);
3524235274 free$(&_2, sizeof(struct structdef), (void (*)(void *))structdef$dest);
@@ -35725,7 +35757,7 @@
3572535757 string$dest(&_5);
3572635758 type_pure$dest(&_4);
3572735759 }
35728- push(0 /* _2 */, &_elems, &_3, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7743);
35760+ push(0 /* _2 */, &_elems, &_3, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7754);
3572935761 typepureid$dest(&_3);
3573035762 }
3573135763 {
@@ -35763,13 +35795,13 @@
3576335795 }
3576435796 struct stack/*typepureid*/ _6; memset(&_6, 0, sizeof(struct stack/*typepureid*/));
3576535797 {
35766- stack(&_6, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7748);
35798+ stack(&_6, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7759);
3576735799 }
3576835800 constr(&_4, &_5, &_6);
3576935801 free$(&_6, sizeof(struct typepureid), (void (*)(void *))typepureid$dest);
3577035802 typepureid$dest(&_5);
3577135803 }
35772- push(0 /* _3 */, &_constrs, &_4, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 7748);
35804+ push(0 /* _3 */, &_constrs, &_4, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 7759);
3577335805 constr$dest(&_4);
3577435806 }
3577535807 {
@@ -35792,13 +35824,13 @@
3579235824 }
3579335825 struct stack/*typepureid*/ _7; memset(&_7, 0, sizeof(struct stack/*typepureid*/));
3579435826 {
35795- stack(&_7, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7749);
35827+ stack(&_7, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7760);
3579635828 }
3579735829 constr(&_5, &_6, &_7);
3579835830 free$(&_7, sizeof(struct typepureid), (void (*)(void *))typepureid$dest);
3579935831 typepureid$dest(&_6);
3580035832 }
35801- push(0 /* _4 */, &_constrs, &_5, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 7749);
35833+ push(0 /* _4 */, &_constrs, &_5, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 7760);
3580235834 constr$dest(&_5);
3580335835 }
3580435836 {
@@ -35821,13 +35853,13 @@
3582135853 }
3582235854 struct stack/*typepureid*/ _8; memset(&_8, 0, sizeof(struct stack/*typepureid*/));
3582335855 {
35824- stack(&_8, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7750);
35856+ stack(&_8, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 7761);
3582535857 }
3582635858 constr(&_6, &_7, &_8);
3582735859 free$(&_8, sizeof(struct typepureid), (void (*)(void *))typepureid$dest);
3582835860 typepureid$dest(&_7);
3582935861 }
35830- push(0 /* _5 */, &_constrs, &_6, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 7750);
35862+ push(0 /* _5 */, &_constrs, &_6, sizeof(struct constr), (void (*)(void *))constr$dest, (void (*)(void *, const void *))constr$copy, 7761);
3583135863 constr$dest(&_6);
3583235864 }
3583335865 {
@@ -39930,7 +39962,7 @@
3993039962 string$dest(&_66);
3993139963 type_pure$dest(&_65);
3993239964 }
39933- push(0 /* _63 */, &_elems, &_64, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 8540);
39965+ push(0 /* _63 */, &_elems, &_64, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 8551);
3993439966 typepureid$dest(&_64);
3993539967 }
3993639968 {
@@ -39949,7 +39981,7 @@
3994939981 string$dest(&_67);
3995039982 type_pure$dest(&_66);
3995139983 }
39952- push(0 /* _64 */, &_elems, &_65, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 8541);
39984+ push(0 /* _64 */, &_elems, &_65, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 8552);
3995339985 typepureid$dest(&_65);
3995439986 }
3995539987 {
@@ -39968,7 +40000,7 @@
3996840000 string$dest(&_68);
3996940001 type_pure$dest(&_67);
3997040002 }
39971- push(0 /* _65 */, &_elems, &_66, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 8542);
40003+ push(0 /* _65 */, &_elems, &_66, sizeof(struct typepureid), (void (*)(void *))typepureid$dest, (void (*)(void *, const void *))typepureid$copy, 8553);
3997240004 typepureid$dest(&_66);
3997340005 }
3997440006 {
@@ -39985,7 +40017,7 @@
3998540017 string$dest(&_70);
3998640018 flavour$dest(&_69);
3998740019 }
39988- push(0 /* _66 */, &*_67, &_68, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 8543);
40020+ push(0 /* _66 */, &*_67, &_68, sizeof(struct structdef), (void (*)(void *))structdef$dest, (void (*)(void *, const void *))structdef$copy, 8554);
3998940021 structdef$dest(&_68);
3999040022 }
3999140023 free$(&_elems, sizeof(struct typepureid), (void (*)(void *))typepureid$dest);
--- trunk/pragmatic/compiler.source.c (revision 406)
+++ trunk/pragmatic/compiler.source.c (revision 407)
@@ -6399,9 +6399,19 @@
63996399 }
64006400 else
64016401 {
6402- let qtypepureid elem = qtypepureid(content.qt, GenPar$(tmpnr));
6402+ let string parid = GenPar$(tmpnr);
6403+ let qtypepureid elem = qtypepureid(content.qt, parid);
64036404 Indent(streams.out, add<u64>(1, level)); EmitQTPI(streams.out, elem); PutStr(streams.out, " = &(("); PutStr(streams.out, par.id); PutStr(streams.out, ")."); PutStr(streams.out, content.id); PutStr(streams.out, ");\n");
64046405
6406+ let stack<ReducedId> redid = reduced_ids;
6407+ over redid
6408+ {
6409+ if strequ(redid.reduced, par.id) then
6410+ {
6411+ push<ReducedId>(reduced_ids, ReducedId(redid.orig, parid)); // propagate reduction (WITHOUT pre-appended *)
6412+ };
6413+ };
6414+
64056415 ParseMatch$(streams, txtpos, structs, level, sp, tmpnr, elem, casenr, ti, content_, usedids, reduced_ids);
64066416 };
64076417 };
@@ -6538,8 +6548,9 @@
65386548 Indent(streams.out, add<u64>(1, level)); PutStrLn(streams.out, "}");
65396549
65406550 let constr constr = at_get$<constr>(f.constrs, idx);
6541- let qtypepureid sub = qtypepureid(qtypepure(par.qt.qualifier, type_pure_normal2(constr.ti.id)), preapp('*', constr.ti.id));
6551+ let qtypepureid sub = qtypepureid(qtypepure(par.qt.qualifier, type_pure_normal2(constr.ti.id)), GenPar$(tmpnr));
65426552 Indent(streams.out, add<u64>(1, level)); EmitQTPI(streams.out, sub); PutStr(streams.out, " = ("); PutStr(streams.out, par.id); PutStr(streams.out, ")."); PutStr(streams.out, constrid); PutStr(streams.out, ".data;\n"); // unbox
6553+ push<ReducedId>(reduced_ids, ReducedId(par.id, sub.id));
65436554 let stack<typepureid> elems = constr.elems;
65446555 ParseMatchStruct$(streams, txtpos, structs, level, sp, tmpnr, sub, casenr, ti, usedids, elems, reduced_ids);
65456556 AssertGet$(streams, txtpos, level, ')');
--- trunk/pragmatic/memory_tests/mem_tests_compiled.c (revision 406)
+++ trunk/pragmatic/memory_tests/mem_tests_compiled.c (revision 407)
@@ -4305,11 +4305,11 @@
43054305 F$2(_0, &(*_1), &(*_2), &(*_3), &(*_4), &(*_5), &(*_6));
43064306 return;
43074307 }
4308- const struct ex *ex = (*_4).ex.data;
4309- const struct string *_7 = &((*ex).s);
4310- const struct string *s = &(*_7);
4311- const uint8_t *_8 = &((*ex).c);
4312- const uint8_t *c = &(*_8);
4308+ const struct ex *_7 = (*_4).ex.data;
4309+ const struct string *_8 = &((*_7).s);
4310+ const struct string *s = &(*_8);
4311+ const uint8_t *_9 = &((*_7).c);
4312+ const uint8_t *c = &(*_9);
43134313 // ignore parameter *_5;
43144314 // ignore parameter *_6;
43154315 {
@@ -4342,9 +4342,9 @@
43424342 F$3(_0, &(*_1), &(*_2), &(*_3), &(*_4), &(*_5), &(*_6));
43434343 return;
43444344 }
4345- const struct ey *ey = (*_4).ey.data;
4346- const uint64_t *_7 = &((*ey).i);
4347- const uint64_t *i = &(*_7);
4345+ const struct ey *_7 = (*_4).ey.data;
4346+ const uint64_t *_8 = &((*_7).i);
4347+ const uint64_t *i = &(*_8);
43484348 // ignore parameter *_5;
43494349 // ignore parameter *_6;
43504350 {
Afficher sur ancien navigateur de dépôt.