2024-03-19 21:43 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000468mercuryBugpublic2018-09-03 12:29
Reporterwangp 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000468: free argument packed with other argument uses uninitialised variable
DescriptionIn high-level C grades, the goal from packed_arg_partial_inst.m

        X = struct(42, _, yes, orange, _, _, _),

compiles to

        {
          MR_Word TypeCtorInfo_13_13;
          MR_Integer Var_10;
          MR_Word Var_11;
          MR_Word Var_12;
          MR_Word Var_6;
          MR_Word Var_7;
          MR_Word Var_8;
          MR_String Var_9;

          Var_10 = (MR_Integer) 42;
          Var_11 = (MR_Integer) 1;
          Var_12 = (MR_Integer) 2;
          {
            MR_Word base;
            base = (MR_Word) MR_new_object(MR_Word, ((MR_Integer) 3 * sizeof(MR_Word)), NULL, NULL);
            (env_ptr)->packed_arg_partial_inst__foo_2_p_0_env_0__X_5 = base;
            MR_hl_field(MR_mktag(0), base, 0) = ((MR_Box) (Var_10));
            MR_hl_field(MR_mktag(0), base, 1) = (MR_Box)
        (((((MR_Unsigned) (Var_6) << (MR_Integer) 6)) |
         (((((MR_Unsigned) (Var_11) << (MR_Integer) 5)) |
         (((((MR_Unsigned) (Var_12) << (MR_Integer) 3)) |
         (((((MR_Unsigned) (Var_7) << (MR_Integer) 2)) |
         (MR_Unsigned) (Var_8)))))))));
            MR_hl_field(MR_mktag(0), base, 2) = NULL;
          }

where Var_6, Var_7, Var_8 are used without being initialised.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0001008

zs (developer)

I am working on a change that involves that code anyway.

~0001009

zs (developer)

Fix committed 2018 sep 3.
+Notes

-Issue History
Date Modified Username Field Change
2018-08-19 13:05 wangp New Issue
2018-08-19 15:22 zs Assigned To => zs
2018-08-19 15:22 zs Status new => assigned
2018-08-19 15:24 zs Note Added: 0001008
2018-09-03 12:29 zs Status assigned => resolved
2018-09-03 12:29 zs Resolution open => fixed
2018-09-03 12:29 zs Note Added: 0001009
+Issue History