summaryrefslogtreecommitdiff
path: root/py/objfun.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/objfun.c
parent2d3d4f74830eddaba8e13ca9a860a5cb7fb2f163 (diff)
py: Allow to pass in read-only buffers to viper and inline-asm funcs.
Fixes #4936.
Diffstat (limited to 'py/objfun.c')
-rw-r--r--py/objfun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objfun.c b/py/objfun.c
index d96c79ede..e0c6fb927 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -472,7 +472,7 @@ STATIC mp_uint_t convert_obj_for_inline_asm(mp_obj_t obj) {
return (mp_uint_t)items;
} else {
mp_buffer_info_t bufinfo;
- if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_WRITE)) {
+ if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_READ)) {
// supports the buffer protocol, return a pointer to the data
return (mp_uint_t)bufinfo.buf;
} else {