diff options
author | jkim <jkim@FreeBSD.org> | 2012-04-23 23:05:14 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-04-23 23:05:14 +0000 |
commit | 6ad6e5ad458430028d7210712b32b42a6a5bd27f (patch) | |
tree | 56922987e2cfefbddd9a8298beb2dce0ea965339 /sys/contrib/dev/acpica/compiler/dtio.c | |
parent | 22fae261d4ee03ee88b67242e0842711fe24b0f3 (diff) | |
parent | eb364ef2c90291c41e896d265d93fe21e48d02a7 (diff) | |
download | FreeBSD-src-6ad6e5ad458430028d7210712b32b42a6a5bd27f.zip FreeBSD-src-6ad6e5ad458430028d7210712b32b42a6a5bd27f.tar.gz |
Merge ACPICA 20120420.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/dtio.c')
-rw-r--r-- | sys/contrib/dev/acpica/compiler/dtio.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c index 5924874..633ed2d 100644 --- a/sys/contrib/dev/acpica/compiler/dtio.c +++ b/sys/contrib/dev/acpica/compiler/dtio.c @@ -89,6 +89,7 @@ DtDumpBuffer ( #define DT_SLASH_SLASH_COMMENT 4 #define DT_END_COMMENT 5 #define DT_MERGE_LINES 6 +#define DT_ESCAPE_SEQUENCE 7 static UINT32 Gbl_NextLineOffset; @@ -412,6 +413,7 @@ DtGetNextLine ( BOOLEAN LineNotAllBlanks = FALSE; UINT32 State = DT_NORMAL_TEXT; UINT32 CurrentLineOffset; + UINT32 BeyondBufferCount; UINT32 i; char c; @@ -503,12 +505,36 @@ DtGetNextLine ( Gbl_CurrentLineBuffer[i] = c; i++; - if (c == '"') + switch (c) { + case '"': + State = DT_NORMAL_TEXT; + break; + + case '\\': + State = DT_ESCAPE_SEQUENCE; + break; + + case '\n': + AcpiOsPrintf ("ERROR at line %u: Unterminated quoted string\n", + Gbl_CurrentLineNumber++); State = DT_NORMAL_TEXT; + break; + + default: /* Get next character */ + break; } break; + case DT_ESCAPE_SEQUENCE: + + /* Just copy the escaped character. TBD: sufficient for table compiler? */ + + Gbl_CurrentLineBuffer[i] = c; + i++; + State = DT_START_QUOTED_STRING; + break; + case DT_START_COMMENT: /* Open comment if this character is an asterisk or slash */ @@ -629,7 +655,19 @@ DtGetNextLine ( } } - printf ("ERROR - Input line is too long (max %u)\n", ASL_LINE_BUFFER_SIZE); + /* Line is too long for internal buffer. Determine actual length */ + + BeyondBufferCount = 1; + c = (char) getc (Handle); + while (c != '\n') + { + c = (char) getc (Handle); + BeyondBufferCount++; + } + + printf ("ERROR - At %u: Input line (%u bytes) is too long (max %u)\n", + Gbl_CurrentLineNumber++, ASL_LINE_BUFFER_SIZE + BeyondBufferCount, + ASL_LINE_BUFFER_SIZE); return (ASL_EOF); } |