about summary refs log tree commit diff
path: root/users/tazjin/presentations/tvix-eval-2023/cppnix-example-smuggling.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/presentations/tvix-eval-2023/cppnix-example-smuggling.cpp')
-rw-r--r--users/tazjin/presentations/tvix-eval-2023/cppnix-example-smuggling.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/users/tazjin/presentations/tvix-eval-2023/cppnix-example-smuggling.cpp b/users/tazjin/presentations/tvix-eval-2023/cppnix-example-smuggling.cpp
new file mode 100644
index 000000000000..37b9219b2eac
--- /dev/null
+++ b/users/tazjin/presentations/tvix-eval-2023/cppnix-example-smuggling.cpp
@@ -0,0 +1,12 @@
+struct Env {
+  // ... some struct fields ...
+  Value* values[0];
+};
+
+// ....
+
+if (env->type == Env::HasWithExpr) {
+  // ...
+  evalAttrs(*env->up, (Expr *) env->values[0], *v, noPos, "<borked>");
+  //                  ^^^^^^^^^^^^^^^^^^^^^^^
+}