Patchwork fwts_iasl_interface.c: allocate temp buffers required for IASL (LP: #1195209)

login
register
mail settings
Submitter Colin King
Date July 1, 2013, 8:05 a.m.
Message ID <1372665936-27179-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/256028/
State Accepted
Headers show

Comments

Colin King - July 1, 2013, 8:05 a.m.
From: Colin Ian King <colin.king@canonical.com>

Earlier changes in ACPICA require us now to allocate some
temporary parsing buffers. Fixes bug LP: #1195209

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpica/source/compiler/fwts_iasl_interface.c | 5 +++++
 1 file changed, 5 insertions(+)
Keng-Yu Lin - July 1, 2013, 9:04 a.m.
On Mon, Jul 1, 2013 at 4:05 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Earlier changes in ACPICA require us now to allocate some
> temporary parsing buffers. Fixes bug LP: #1195209
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpica/source/compiler/fwts_iasl_interface.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/acpica/source/compiler/fwts_iasl_interface.c b/src/acpica/source/compiler/fwts_iasl_interface.c
> index 76f6356..84670e4 100644
> --- a/src/acpica/source/compiler/fwts_iasl_interface.c
> +++ b/src/acpica/source/compiler/fwts_iasl_interface.c
> @@ -42,6 +42,11 @@ static void init_asl_core(void)
>         Gbl_Files[ASL_FILE_STDOUT].Filename = "STDOUT";
>         Gbl_Files[ASL_FILE_STDERR].Handle   = stdout;
>         Gbl_Files[ASL_FILE_STDERR].Filename = "STDOUT";
> +
> +       Gbl_LineBufferSize = 16384;
> +       Gbl_CurrentLineBuffer = NULL;
> +       Gbl_MainTokenBuffer = NULL;
> +       UtExpandLineBuffers();
>  }
>
>  int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
> --
> 1.8.1.2
>

Verified the patch fixed the segfault issue.
Thanks Colin. :-)

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - July 1, 2013, 9:14 a.m.
On 07/01/2013 04:05 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Earlier changes in ACPICA require us now to allocate some
> temporary parsing buffers. Fixes bug LP: #1195209
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpica/source/compiler/fwts_iasl_interface.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/acpica/source/compiler/fwts_iasl_interface.c b/src/acpica/source/compiler/fwts_iasl_interface.c
> index 76f6356..84670e4 100644
> --- a/src/acpica/source/compiler/fwts_iasl_interface.c
> +++ b/src/acpica/source/compiler/fwts_iasl_interface.c
> @@ -42,6 +42,11 @@ static void init_asl_core(void)
>   	Gbl_Files[ASL_FILE_STDOUT].Filename = "STDOUT";
>   	Gbl_Files[ASL_FILE_STDERR].Handle   = stdout;
>   	Gbl_Files[ASL_FILE_STDERR].Filename = "STDOUT";
> +
> +	Gbl_LineBufferSize = 16384;
> +	Gbl_CurrentLineBuffer = NULL;
> +	Gbl_MainTokenBuffer = NULL;
> +	UtExpandLineBuffers();
>   }
>
>   int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/acpica/source/compiler/fwts_iasl_interface.c b/src/acpica/source/compiler/fwts_iasl_interface.c
index 76f6356..84670e4 100644
--- a/src/acpica/source/compiler/fwts_iasl_interface.c
+++ b/src/acpica/source/compiler/fwts_iasl_interface.c
@@ -42,6 +42,11 @@  static void init_asl_core(void)
 	Gbl_Files[ASL_FILE_STDOUT].Filename = "STDOUT";
 	Gbl_Files[ASL_FILE_STDERR].Handle   = stdout;
 	Gbl_Files[ASL_FILE_STDERR].Filename = "STDOUT";
+
+	Gbl_LineBufferSize = 16384;
+	Gbl_CurrentLineBuffer = NULL;
+	Gbl_MainTokenBuffer = NULL;
+	UtExpandLineBuffers();
 }
 
 int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)