Skip to content
This repository
Browse code

Make the max subroutine length compile-time configurable constant, de…

…fault = 64KB
  • Loading branch information...
commit b68004ad3f4f44d5f22d0ebaa815b4965f738695 1 parent ebdb710
Duke Leto authored

Showing 2 changed files with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 0  config.h
  2. +2 1  plparrot.c
2  config.h
... ... @@ -0,0 +1,2 @@
  1 +/* Default max sub lenght of 64KB */
  2 +#define MAX_SUBROUTINE_LENGTH 1024*64
3  plparrot.c
... ... @@ -1,4 +1,5 @@
1 1 #include "plparrot.h"
  2 +#include "config.h"
2 3
3 4 /* Parrot header files */
4 5 #include "parrot/embed.h"
@@ -182,7 +183,7 @@ plparrot_func_handler(PG_FUNCTION_ARGS)
182 183 pir_src = malloc( 13 + length + 4 );
183 184 memcpy(pir_src, pir_begin, 13);
184 185 /* This should have a sane default and be configurable */
185   - strncat(pir_src, proc_src, 1000);
  186 + strncat(pir_src, proc_src, MAX_SUBROUTINE_LENGTH);
186 187 strncat(pir_src, pir_end, 4);
187 188
188 189 /* elog(NOTICE,"about to compile a PIR string: %s", pir_src); */

0 comments on commit b68004a

Please sign in to comment.
Something went wrong with that request. Please try again.