summaryrefslogtreecommitdiff
path: root/codegen.py
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2010-02-04 21:31:55 +0000
committerMatthias Radestock <matthias@lshift.net>2010-02-04 21:31:55 +0000
commit21218f795e8416bbd9f0b3e091354b2e21367e37 (patch)
tree9ac5f53793c053d6e4cdde13703fbc97527ff19a /codegen.py
parentf6c9404bc1977d7fbddde99d8f3916bcfb4bd1e8 (diff)
parent75c480ff41d4568334a5bdc92c6aa6c8ee572516 (diff)
downloadrabbitmq-server-git-21218f795e8416bbd9f0b3e091354b2e21367e37.tar.gz
merge default into bug22309
Diffstat (limited to 'codegen.py')
-rw-r--r--codegen.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/codegen.py b/codegen.py
index 6f39574f26..648983f1f2 100644
--- a/codegen.py
+++ b/codegen.py
@@ -214,6 +214,8 @@ def genErl(spec):
elif type == 'table':
print " F%d = rabbit_binary_parser:parse_table(F%dTab)," % \
(f.index, f.index)
+ elif type == 'shortstr':
+ print " if F%dLen > 255 -> exit(method_field_shortstr_overflow); true -> ok end," % (f.index)
else:
pass
@@ -246,7 +248,10 @@ def genErl(spec):
elif type == 'table':
print " F%dTab = rabbit_binary_generator:generate_table(F%d)," % (f.index, f.index)
print " F%dLen = size(F%dTab)," % (f.index, f.index)
- elif type in ['shortstr', 'longstr']:
+ elif type == 'shortstr':
+ print " F%dLen = size(F%d)," % (f.index, f.index)
+ print " if F%dLen > 255 -> exit(method_field_shortstr_overflow); true -> ok end," % (f.index)
+ elif type == 'longstr':
print " F%dLen = size(F%d)," % (f.index, f.index)
else:
pass