Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: nacl_bindings_generator/generate_nacl_bindings.py

Issue 988323004: NaCl: disable unimplmented Mojo APIs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nacl_bindings/mojo_syscall.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nacl_bindings_generator/generate_nacl_bindings.py
diff --git a/nacl_bindings_generator/generate_nacl_bindings.py b/nacl_bindings_generator/generate_nacl_bindings.py
index e06ffa91188d18863f79fb27e150e8144c3154f3..d3748232f78e4764b6108e1dc8b9daa9c62c50df 100755
--- a/nacl_bindings_generator/generate_nacl_bindings.py
+++ b/nacl_bindings_generator/generate_nacl_bindings.py
@@ -307,11 +307,27 @@ def GenerateMojoSyscall(functions, common_vars, out):
code.PushMargin()
for f in functions:
+ is_implemented = True
+
+ # Mojo API calls that take or return pointers are currently not supported.
+ # The underlying Mojo implementation is unaware of NaCl's address space. In
+ # addition, if we pass blindly pass the parameters through to the underlying
+ # Mojo API, memory corruption can result from pointer-size mistmatches.
+ for p in f.params:
+ if p.base_type.endswith("*"):
+ is_implemented = False
+
impls = [ImplForParam(p) for p in f.params]
impls.append(ImplForParam(f.result_param))
code << 'case %d:' % f.uid
+ if not is_implemented:
+ with code.Indent():
+ code << 'fprintf(stderr, "%s not implemented\\n");' % f.name
+ code << 'return -1;'
+ continue
+
code.PushMargin()
code << '{'
« no previous file with comments | « nacl_bindings/mojo_syscall.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698