summaryrefslogtreecommitdiff
path: root/codegen.py
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-02-04 16:08:26 +0000
committerMatthew Sackman <matthew@lshift.net>2010-02-04 16:08:26 +0000
commit0c5bcb5b35d3ba5bf5a435d39acd8fba0f97d539 (patch)
tree7eac41cb09826283fcf95017da17008afd72fbf1 /codegen.py
parenta1200e94985fd46dcf70e950910d120131c89380 (diff)
parent75c480ff41d4568334a5bdc92c6aa6c8ee572516 (diff)
downloadrabbitmq-server-git-0c5bcb5b35d3ba5bf5a435d39acd8fba0f97d539.tar.gz
Merging default into bug21673
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