4
0
Эх сурвалжийг харах

src/lib.rs: fix bytecode in some examples

Some doc examples have programs written in bytecode with assembly
instructions written in comments. Some of the "mov r0, 0" instructions
were not correct, fix them.

I just happened to notice those errors, I haven't run any particular
test to double check all instructions.
Quentin Monnet 6 жил өмнө
parent
commit
af2495e891
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      src/lib.rs

+ 3 - 3
src/lib.rs

@@ -133,7 +133,7 @@ impl<'a> EbpfVmMbuff<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[
@@ -778,7 +778,7 @@ impl<'a> EbpfVmFixedMbuff<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[
@@ -1069,7 +1069,7 @@ impl<'a> EbpfVmRaw<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[