summaryrefslogtreecommitdiff
path: root/py/nativeglue.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-08-05 16:32:10 +1000
committerDamien George <damien.p.george@gmail.com>2019-08-06 15:58:23 +1000
commitcd35dd9d9a29836906acdce60c931f6352b536d0 (patch)
tree7fe4f06cceb784bafb26794c847babd34e90d162 /py/nativeglue.c
parent2d3d4f74830eddaba8e13ca9a860a5cb7fb2f163 (diff)
py: Allow to pass in read-only buffers to viper and inline-asm funcs.
Fixes #4936.
Diffstat (limited to 'py/nativeglue.c')
-rw-r--r--py/nativeglue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c
index 979265a87..eb02907bd 100644
--- a/py/nativeglue.c
+++ b/py/nativeglue.c
@@ -65,7 +65,7 @@ mp_uint_t mp_native_from_obj(mp_obj_t obj, mp_uint_t type) {
case MP_NATIVE_TYPE_UINT: return mp_obj_get_int_truncated(obj);
default: { // cast obj to a pointer
mp_buffer_info_t bufinfo;
- if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_RW)) {
+ if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_READ)) {
return (mp_uint_t)bufinfo.buf;
} else {
// assume obj is an integer that represents an address