@@ -3645,6 +3645,8 @@ make the function's CFI jump table canonical. See :ref:`the CFI documentation
36453645
36463646def KCFISaltDocs : Documentation {
36473647 let Category = DocCatFunction;
3648+ let Heading = "kcfi_salt";
3649+ let Label = "langext-kcfi_salt";
36483650 let Content = [{
36493651Use ``__attribute__((kcfi_salt("<salt>")))`` on a function declaration, function
36503652definition, or typedef to help distinguish CFI hashes between functions with
@@ -3655,7 +3657,7 @@ Example use:
36553657.. code-block:: c
36563658
36573659 // .h file:
3658- #define __kcfi_salt __attribute__((kcfi_salt("vogon ")))
3660+ #define __kcfi_salt __attribute__((kcfi_salt("pepper ")))
36593661
36603662 // Convenient typedefs to avoid nested declarator syntax.
36613663 typedef int (*fptr_t)(void); // Non-salted function call.
@@ -3676,26 +3678,26 @@ Example use:
36763678 .init = internal_init,
36773679 .exec = internal_salted_exec,
36783680 .teardown = internal_teardown,
3679- }
3681+ };
36803682
3681- struct widget_generator *widget_gen = _generator;
3683+ struct widget_generator *widget_gen = & _generator;
36823684
36833685 // 2nd .c file:
36843686 int generate_a_widget(void) {
36853687 int ret;
36863688
36873689 // Called with non-salted CFI.
3688- ret = widget_gen. init();
3690+ ret = widget_gen-> init();
36893691 if (ret)
36903692 return ret;
36913693
36923694 // Called with salted CFI.
3693- ret = widget_gen. exec();
3695+ ret = widget_gen-> exec();
36943696 if (ret)
36953697 return ret;
36963698
36973699 // Called with non-salted CFI.
3698- return widget_gen. teardown();
3700+ return widget_gen-> teardown();
36993701 }
37003702
37013703 }];
0 commit comments