diff options
Diffstat (limited to 'src/lib_buffer.c')
-rw-r--r-- | src/lib_buffer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib_buffer.c b/src/lib_buffer.c index f13320c4..cb7531a2 100644 --- a/src/lib_buffer.c +++ b/src/lib_buffer.c | |||
@@ -126,6 +126,7 @@ LJLIB_CF(buffer_method_put) | |||
126 | lj_strfmt_putfnum((SBuf *)sbx, STRFMT_G14, numV(o)); | 126 | lj_strfmt_putfnum((SBuf *)sbx, STRFMT_G14, numV(o)); |
127 | } else if (tvisbuf(o)) { | 127 | } else if (tvisbuf(o)) { |
128 | SBufExt *sbx2 = bufV(o); | 128 | SBufExt *sbx2 = bufV(o); |
129 | if (sbx2 == sbx) lj_err_arg(L, arg+1, LJ_ERR_BUFFER_SELF); | ||
129 | lj_buf_putmem((SBuf *)sbx, sbx2->r, sbufxlen(sbx2)); | 130 | lj_buf_putmem((SBuf *)sbx, sbx2->r, sbufxlen(sbx2)); |
130 | } else if (!mo && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { | 131 | } else if (!mo && !tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { |
131 | /* Call __tostring metamethod inline. */ | 132 | /* Call __tostring metamethod inline. */ |