summaryrefslogtreecommitdiff
path: root/codegen.py
diff options
context:
space:
mode:
Diffstat (limited to 'codegen.py')
-rw-r--r--codegen.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/codegen.py b/codegen.py
index 6f39574f26..96109610ad 100644
--- a/codegen.py
+++ b/codegen.py
@@ -18,11 +18,11 @@
## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
## Technologies LLC, and Rabbit Technologies Ltd.
##
-## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
+## Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
## Ltd. Portions created by Cohesive Financial Technologies LLC are
-## Copyright (C) 2007-2009 Cohesive Financial Technologies
+## Copyright (C) 2007-2010 Cohesive Financial Technologies
## LLC. Portions created by Rabbit Technologies Ltd are Copyright
-## (C) 2007-2009 Rabbit Technologies Ltd.
+## (C) 2007-2010 Rabbit Technologies Ltd.
##
## All Rights Reserved.
##
@@ -116,11 +116,11 @@ def printFileHeader():
%% are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
%% Technologies LLC, and Rabbit Technologies Ltd.
%%
-%% Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
+%% Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
%% Ltd. Portions created by Cohesive Financial Technologies LLC are
-%% Copyright (C) 2007-2009 Cohesive Financial Technologies
+%% Copyright (C) 2007-2010 Cohesive Financial Technologies
%% LLC. Portions created by Rabbit Technologies Ltd are Copyright
-%% (C) 2007-2009 Rabbit Technologies Ltd.
+%% (C) 2007-2010 Rabbit Technologies Ltd.
%%
%% All Rights Reserved.
%%
@@ -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